Skip to content

fix: preserve custom results with generic metadata - #1197

Open
jmagar wants to merge 1 commit into
modelcontextprotocol:mainfrom
dinglebear-ai:fix/custom-result-meta-classification-upstream
Open

fix: preserve custom results with generic metadata#1197
jmagar wants to merge 1 commit into
modelcontextprotocol:mainfrom
dinglebear-ai:fix/custom-result-meta-classification-upstream

Conversation

@jmagar

@jmagar jmagar commented Aug 20, 2026

Copy link
Copy Markdown

Summary

ServerResult is an untagged union. CallToolResult currently accepts protocol-generic _meta as sufficient evidence that a response is a tool result. Custom MCP extension results that legitimately carry resultType: complete and _meta can therefore be consumed as CallToolResult, dropping extension-specific fields before callers can deserialize them.

This change requires at least one tool-specific field (content, structuredContent, or isError) before CallToolResult matches. Generic resultType / _meta alone fall through to CustomResult.

Regression coverage

  • custom extension result with resultType, _meta, and skills remains CustomResult
  • genuine tool result with content and _meta remains CallToolResult

Focused rmcp library tests pass on current main (3.1.4).

@jmagar
jmagar requested a review from a team as a code owner August 20, 2026 11:46
@github-actions github-actions Bot added the T-core Core library changes label Aug 20, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant