Skip to content

fix: MCP 工具参数验证错误提示不清晰,缺乏参数示例#621

Open
binggg wants to merge 3 commits intomainfrom
automation/attribution-issue-mo8yzj2s-zu5l9q-mcp-moisklmv
Open

fix: MCP 工具参数验证错误提示不清晰,缺乏参数示例#621
binggg wants to merge 3 commits intomainfrom
automation/attribution-issue-mo8yzj2s-zu5l9q-mcp-moisklmv

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 28, 2026

Attribution issue

  • issueId: issue_mo8yzj2s_zu5l9q
  • category: tool
  • canonicalTitle: MCP 工具参数验证错误提示不清晰,缺乏参数示例
  • representativeRun: atomic-js-cloudbase-list-functions/2026-04-21T18-40-35-64vunc

Automation summary

  • root_cause: MCP tools (queryFunctions, manageFunctions, queryGateway, manageGateway) use an "action" dispatch pattern where a single tool supports many operations, but the tool descriptions and parameter descriptions don't clearly map each action to its required/optional parameters or provide concrete call examples. When the MCP SDK's Zod validation catches an invalid parameter (e.g., wrong type, missing required field for a specific action), it returns a terse error like "Invalid arguments for tool X: " without context about which action's requirements were violated or what valid values look like. Agents then can't self-correct.
  • changes: Enhanced tool descriptions for queryFunctions, manageFunctions, queryGateway, and manageGateway in mcp/src/tools/functions.ts and mcp/src/tools/gateway.ts. Added: (1) action→parameter requirement mapping (which params are required/optional for each action value), (2) concrete JSON call examples for the most common actions, (3) more specific parameter descriptions listing which actions require each parameter. This is a Layer 1 fix (tool description improvement only, no code logic changes).
  • validation: TypeScript compilation p

Changed files

  • mcp/src/tools/functions.ts
  • mcp/src/tools/gateway.ts

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant