Skip to content

fix(model): don't treat _meta alone as a CallToolResult - #1405

Merged
DaleSeo merged 1 commit into
modelcontextprotocol:mainfrom
howardjohn:serde/custom-meta
Nov 5, 2026
Merged

DaleSeo merged 1 commit into
modelcontextprotocol:mainfrom
howardjohn:serde/custom-meta

Conversation

@howardjohn

Copy link
Copy Markdown
Contributor

Motivation and Context

There is existing logic to avoid CallToolResult from shadowing CustomResult. However, since any type can hold _meta this doesn't really work.

In real world I am trying to use the skills extension deserialized into CustomResult. When _meta is present this fails.

How Has This Been Tested?

Manually tested end to end + added/updated unit tests

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Any result type may carry `_meta`, so its presence says nothing about a
result being a tool call. Counting it as a known CallToolResult field let
CallToolResult shadow CustomResult in the untagged ServerResult union: a
custom result such as SEP-2640 `skills/list` with a top-level `_meta`
parsed as an empty CallToolResult and its payload was dropped.

Only `content`, `structuredContent`, and `isError` now satisfy the guard.
Like `{}`, a bare `{"_meta": {...}}` is no longer a CallToolResult; it
falls through to CustomResult.
@howardjohn
howardjohn requested a review from a team as a code owner October 28, 2026 20:20
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T20:20:47.669132Z 9930a77 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes labels Oct 28, 2026
@github-actions
github-actions Bot requested a review from gocamille October 28, 2026 20:21
@github-actions

Copy link
Copy Markdown
Contributor

@gocamille is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

@DaleSeo
DaleSeo merged commit 429524d into modelcontextprotocol:main Nov 5, 2026
28 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants