fix: CallToolResult emits spec isError; structuredContent typed as object - #49
Merged
Conversation
…ontent as object Fast-follow polish on the merged structured-output PR (#45), from the Codex review: - CallToolResult now serializes `is_error` under the MCP wire key `isError` (added to StructTypes.names). Spec-compliant clients read `isError` to detect tool failures, so previously every tool error looked like success to them. Wire-key only; the Julia field stays `is_error`. - `CallToolResult.structured_content` typed `Union{Nothing,AbstractDict}` (was effectively `Any`) -- MCP structuredContent is a JSON object; this rejects root scalars/arrays and non-serializable values at construction. - Updated the two tests that asserted the serialized `is_error` key. Suite green (499). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kalidke
added a commit
that referenced
this pull request
Jun 9, 2026
Add the missing 0.5.0 entries (#39 feature gating, #40 e2e harness, #44 annotations, #45 structured output, #49 isError wire-key fix, #50 progress notifications), credit @samtalki's contributions, backfill [0.4.0]/[0.4.1] sections, update compare links, and set the release date. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Fast-follow polish on the merged structured-output PR (#45), from the Codex review of the samtalki PRs.
Changes
is_error→isErrorwire key (the important one):CallToolResultnow serializes its error flag under the MCP spec keyisError(added toStructTypes.names). Spec-compliant clients readisErrorto detect tool failures — so until now every tool error looked like a success to them. Julia field staysis_error; only the wire key changes.structured_contenttypedUnion{Nothing,AbstractDict}(was effectivelyAny). MCPstructuredContentis a JSON object; this rejects root scalars/arrays and non-serializable values at construction time.is_errorkey (test_http,serialization).Suite green (499). No version bump — part of the unreleased 0.5.0.
🤖 Generated with Claude Code