Repository navigation
fix(web): carry MCP tool error problems in _meta, as Protean does - #26
Merged
Merged
Conversation
Protean PR #91 moved a stable-code tool error's RFC 9457 problem from structuredContent to the result _meta under "org.htcom.protean/problem" (McpToolResult.PROBLEM_META_KEY). A declared outputSchema describes the success payload and the spec requires structuredContent to conform to it; clients that validate error results too, such as the TypeScript SDK 1.x, replaced the actual error with a schema-violation error. mcp_tool_problem now writes the problem under MCP_PROBLEM_META_KEY and no structuredContent. The [CODE] text, successful results, and JSON-RPC error.data are unchanged. A new test probes every tool that declares an outputSchema on its error path, as Java's conformance test does, and checks scope_list's STATE_CONFLICT over HTTP. docs(design): record the problem's place in tool error results Design 17 §4 and design 30 name the _meta key. Tags: #mcp #parity Co-Authored-By: htjulia <htjulia1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Protean PR htcom-code/protean#91 (issue #90) moved a stable-code MCP tool error's RFC 9457 problem from
structuredContentto the result_meta["org.htcom.protean/problem"]. Protrus now does the same.mcp_tool_problemwrites the problem underMCP_PROBLEM_META_KEYand carries nostructuredContenton error results. The[CODE] detailtext, successful results, and JSON-RPCerror.dataare unchanged.outputSchemadescribes the success payload, and the spec requiresstructuredContentto conform to it. Clients that validate error results too (TypeScript SDK 1.x) replaced the actual error with a schema-violation error._meta. A new test,coded_tool_errors_carry_their_problem_in_meta, mirrors Java'sMcpOutputSchemaConformanceTest.error_results_never_carry_a_nonconforming_structured_content(every tool with anoutputSchemaon its error path, at least 10 tools, includingscope_list,get_module,module_versions) andMcpHttpControllerTest.coded_tool_error_over_http_carries_its_problem_in_meta.list_runtimesscopewas already nullable, so Java Per-module isolation mode (isolation.mode, isolation_mode) on the worker host #89 needs no change here.Verification
cargo test -p protrus-web: 75 passed.cargo test --workspace: 310 passed, 0 failed on the second run. The first run stopped at one failing test binary that passed on the rerun; this looks like the known host e2e flake tracked on the task.cargo clippy -p protrus-web --tests: no new warnings (theControlCommandResultsize warning is pre-existing).