Skip to content

feat(mcp): add full _meta field support for CallToolResult objects#1

Merged
bostdiek merged 1 commit into
mainfrom
feat/mcp-meta-field-support
Nov 17, 2025
Merged

feat(mcp): add full _meta field support for CallToolResult objects#1
bostdiek merged 1 commit into
mainfrom
feat/mcp-meta-field-support

Conversation

@bostdiek

Copy link
Copy Markdown
Owner
  • Extract and preserve complete _meta field from MCP CallToolResult responses
  • Merge metadata into additional_properties of converted content items
  • Handle isError field for proper error state integration
  • Support arbitrary metadata like token usage, costs, and performance metrics
  • Maintain backward compatibility with existing tool execution workflows
  • Add comprehensive test coverage for all metadata scenarios including edge cases
  • Update documentation with metadata handling examples and patterns

Fixes protocol compliance violation where _meta fields were being dropped,
enables proper monitoring and cost tracking of MCP tool usage.

Motivation and Context

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

- Extract and preserve complete _meta field from MCP CallToolResult responses
- Merge metadata into additional_properties of converted content items
- Handle isError field for proper error state integration
- Support arbitrary metadata like token usage, costs, and performance metrics
- Maintain backward compatibility with existing tool execution workflows
- Add comprehensive test coverage for all metadata scenarios including edge cases
- Update documentation with metadata handling examples and patterns

Fixes protocol compliance violation where _meta fields were being dropped,
enables proper monitoring and cost tracking of MCP tool usage.
@bostdiek bostdiek merged commit 58838fc into main Nov 17, 2025
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