Skip to content

render tool errors as llmxml - #39

Merged
xobotyi merged 1 commit into
mainfrom
llmxml-errors
Jul 10, 2026
Merged

render tool errors as llmxml#39
xobotyi merged 1 commit into
mainfrom
llmxml-errors

Conversation

@xobotyi

@xobotyi xobotyi commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

All in-band tool-call errors — SDK argument validation, client-side refusals, Gerrit API passthrough — now reach the model wrapped as <error tool="NAME">message</error>, applied by a single receiving middleware so validation errors (which never reach handler code) are covered too. Protocol-level failures stay JSON-RPC errors; the MCP isError flag is untouched.

ADR 1.3 amended: error shape joins the published output contract, pinned by golden files.

Verified live against Gerrit: validation, wrong-type, Gerrit-400 passthrough all wrapped; unknown-tool remains a JSON-RPC error.

Success output speaks llmxml (ADR 1.3); errors were the one surface
breaking the dialect, reaching the model as bare prose. Receiving
middleware rewraps in-band error text as
<error tool="NAME">message</error> at one choke point covering SDK
argument validation, client-side refusals, and Gerrit API passthrough
alike; per-handler wrapping would miss validation errors, which never
reach handler code.

Protocol-level failures (unknown tool) stay JSON-RPC errors; the MCP
isError flag is untouched. Error shape is pinned by golden files
alongside success renders.
@xobotyi
xobotyi merged commit 7699023 into main Jul 10, 2026
5 checks passed
@xobotyi
xobotyi deleted the llmxml-errors branch July 10, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant