Skip to content

fix: ignore malformed WebMCP tool descriptors in execute input - #877

Open
adityajai119 wants to merge 1 commit into
modelcontextprotocol:mainfrom
adityajai119:fix/w5-bug
Open

adityajai119 wants to merge 1 commit into
modelcontextprotocol:mainfrom
adityajai119:fix/w5-bug

Conversation

@adityajai119

Copy link
Copy Markdown

When a page's WebMCP model context exposes a tool descriptor whose \inputSchema\ getter throws, \webMcpExecuteInput()\ propagates the error. That makes a \ ools/call\ for an unrelated, valid tool fail with \isError, even though \ownWebMcpTools()\ and \ oMcpTool()\ already treat untrusted descriptors as malformed and skip them.

Fix: guard the \inputSchema\ read per descriptor so a broken descriptor is ignored when deciding whether to pass JSON input to \executeTool().

Tests: added \src/webmcp.test.ts\ with failing-before/passing-after cases. Narrow test and Prettier check on touched files pass.

This branch has not been deployed

No deployments
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