Skip to content

fix: CallToolResult emits spec isError; structuredContent typed as object - #49

Merged
kalidke merged 1 commit into
mainfrom
fix/calltoolresult-wire-keys
Jun 9, 2026
Merged

fix: CallToolResult emits spec isError; structuredContent typed as object#49
kalidke merged 1 commit into
mainfrom
fix/calltoolresult-wire-keys

Conversation

@kalidke

@kalidke kalidke commented Jun 9, 2026

Copy link
Copy Markdown
Member

Fast-follow polish on the merged structured-output PR (#45), from the Codex review of the samtalki PRs.

Changes

  • is_errorisError wire key (the important one): CallToolResult now serializes its error flag under the MCP spec key isError (added to StructTypes.names). Spec-compliant clients read isError to detect tool failures — so until now every tool error looked like a success to them. Julia field stays is_error; only the wire key changes.
  • 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 time.
  • Updated the two tests that asserted the serialized is_error key (test_http, serialization).

Suite green (499). No version bump — part of the unreleased 0.5.0.

🤖 Generated with Claude Code

…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
kalidke merged commit 3eec447 into main Jun 9, 2026
7 checks passed
@kalidke
kalidke deleted the fix/calltoolresult-wire-keys branch June 9, 2026 17:50
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>
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