Skip to content

Forward extra kwargs in McpServer.call_tool override#426

Merged
bbqiu merged 2 commits into
mainfrom
bbqiu/fix-mcp-call-tool-meta-fwd
May 8, 2026
Merged

Forward extra kwargs in McpServer.call_tool override#426
bbqiu merged 2 commits into
mainfrom
bbqiu/fix-mcp-call-tool-meta-fwd

Conversation

@bbqiu
Copy link
Copy Markdown
Collaborator

@bbqiu bbqiu commented Apr 28, 2026

The override McpServer.call_tool(self, tool_name, arguments) drops kwargs that newer versions of openai-agents pass to the parent. When the agents SDK at agents/mcp/util.py resolves a non-None merged_meta, it calls server.call_tool(tool.name, json_data, meta=merged_meta), which fails:

TypeError: McpServer.call_tool() got an unexpected keyword argument 'meta'

This breaks all MCP tool calls (system.ai UC functions, Genie spaces, Vector Search, custom Apps-hosted MCP servers) for users on a recent openai-agents whenever the meta-passing branch is taken.

Forward **kwargs to the parent so the override stays compatible with both old and new SDK signatures: empty kwargs forward as no-ops to old parents, and meta (or any future additions) reach new parents intact.

Co-authored-by: Isaac

The override `McpServer.call_tool(self, tool_name, arguments)` drops kwargs
that newer versions of `openai-agents` pass to the parent. When the agents
SDK at `agents/mcp/util.py` resolves a non-None `merged_meta`, it calls
`server.call_tool(tool.name, json_data, meta=merged_meta)`, which fails:

    TypeError: McpServer.call_tool() got an unexpected keyword argument 'meta'

This breaks all MCP tool calls (system.ai UC functions, Genie spaces,
Vector Search, custom Apps-hosted MCP servers) for users on a recent
`openai-agents` whenever the meta-passing branch is taken.

Forward `**kwargs` to the parent so the override stays compatible with both
old and new SDK signatures: empty kwargs forward as no-ops to old parents,
and `meta` (or any future additions) reach new parents intact.

Co-authored-by: Isaac
Signed-off-by: Bryan Qiu <bryan.qiu@databricks.com>
@bbqiu bbqiu requested a review from annzhang-db May 8, 2026 00:10
Co-authored-by: Isaac
Signed-off-by: Bryan Qiu <bryan.qiu@databricks.com>
@bbqiu bbqiu enabled auto-merge (squash) May 8, 2026 00:38
@bbqiu bbqiu merged commit a500eb1 into main May 8, 2026
46 checks passed
@bbqiu bbqiu deleted the bbqiu/fix-mcp-call-tool-meta-fwd branch May 8, 2026 00:40
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.

2 participants