Skip to content

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

Open
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mo8yzj2s-zu5l9q-mcp
Open

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

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: When MCP tool parameter validation fails (e.g., missing required parameters), the error messages only indicate which parameter is required but don't provide examples of valid parameter values. This makes it difficult for AI agents to understand how to correctly call the tool.
  • changes: Updated all parameter validation error messages in mcp/src/tools/functions.ts and mcp/src/tools/gateway.ts to include concrete examples of valid parameter values. For example, changed throw new Error("getFunctionDetail 操作时,functionName 参数是必需的") to throw new Error("getFunctionDetail 操作时,functionName 参数是必需的。示例:{ \"action\": \"getFunctionDetail\", \"functionName\": \"hello-world\" }").
  • validation: All tests pass (skill-quality-standards.test.js, build-skills-repo.test.js, build-compat-config.test.js, functions.test.ts, gateway.test.ts). TypeScript compilation succeeds with no errors.
  • follow_up: The changes improve error messages for the functions and gateway tools. Other tools may benefit from similar improvements if they have comparable error messages. The fix is minimal and focused on Layer 1 (error message improvement) as recommended in the fix priority guidelines.

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.

@binggg
Copy link
Copy Markdown
Member Author

binggg commented Apr 28, 2026

Attribution post-PR evaluation

  • visibility: internal identifiers, run ids, and private links are intentionally omitted
  • attempt: 1
  • eval_scope: primary_only
  • overall: FAILED
  • summary: at least one planned evaluation case failed
  • updated_at: 2026-04-28T15:29:46.434Z

Cases

  • [FAILED] — primary — evaluation failed

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