Skip to content

fix(mcp): filter out _placeholder param from tool arguments#15078

Open
dotuananh0712 wants to merge 2 commits intoanomalyco:devfrom
dotuananh0712:fix/mcp-placeholder-filter
Open

fix(mcp): filter out _placeholder param from tool arguments#15078
dotuananh0712 wants to merge 2 commits intoanomalyco:devfrom
dotuananh0712:fix/mcp-placeholder-filter

Conversation

@dotuananh0712
Copy link

@dotuananh0712 dotuananh0712 commented Feb 25, 2026

Issue for this PR

Closes #15041

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Filters out the _placeholder key from tool arguments before sending to MCP servers.

The Vercel AI SDK adds _placeholder to tool arguments when the input schema is empty. This causes ZodError in MCP servers like Supabase that don't accept extra keys (expects z.object({}) but receives {_placeholder: true}).

The fix filters out _placeholder from args in convertMcpTool before calling client.callTool().

How did you verify your code works?

  • Tested locally with affected MCP servers

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Prevent MCP servers from appearing in the @ autocomplete menu by filtering out agents whose names start with 'mcps/'. Only agents/subagents should appear in the autocomplete.

Fixes anomalyco#14399
The Vercel AI SDK adds _placeholder to tool arguments when the input
schema is empty. This causes ZodError in MCP servers like Supabase that
don't accept extra keys.

This change filters out _placeholder before sending to the MCP server.
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Feb 25, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

MCP tool wrappers send extra _placeholder param causing ZodError in Supabase MCP + empty response in PythonAnywhere MCP

1 participant