Skip to content

fix: callCloudApi MCP 工具的 schema/prompt 未清晰标注 CreateUser 必填参数(EnvId),且参数命名约定不明确导致模型首次调用失败#675

Open
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mojd35i1-ptw5mr-callcloudapi-mcp-schema-prompt-createuse-mojeyisf
Open

fix: callCloudApi MCP 工具的 schema/prompt 未清晰标注 CreateUser 必填参数(EnvId),且参数命名约定不明确导致模型首次调用失败#675
binggg wants to merge 1 commit intomainfrom
automation/attribution-issue-mojd35i1-ptw5mr-callcloudapi-mcp-schema-prompt-createuse-mojeyisf

Conversation

@binggg
Copy link
Copy Markdown
Member

@binggg binggg commented Apr 29, 2026

Attribution issue

  • issueId: issue_mojd35i1_ptw5mr
  • category: tool
  • canonicalTitle: callCloudApi MCP 工具的 schema/prompt 未清晰标注 CreateUser 必填参数(EnvId),且参数命名约定不明确导致模型首次调用失败
  • representativeRun: atomic-js-cloudbase-cli-user-create/2026-04-29T01-10-03-cz94u1

Automation summary

  • root_cause: The callCloudApi MCP tool had two problems causing models to fail on first call when using CreateUser: (1) It did not auto-inject EnvId into the params even though the environment ID was already available from the auth context, forcing the model to remember to include it manually; (2) The tool description did not clearly specify that params must be flat (not nested like { "User": {...} }) and that parameter names are case-sensitive and must match the official API (e.g., Name not UserName, Type not UserType, UserStatus not Status). The trace shows the agent used UserName, UserType, Status, nested everything in a User object, and omitted EnvId.
  • changes: Modified mcp/src/tools/capi.ts with two fixes: (1) Layer 2 - Auto-inject EnvId: When service === 'tcb' and the action requires EnvId (per TCB_ACTION_INDEX_MAP.requiredKeys) but the caller didn't include it, the tool now resolves the current environment ID via getEnvId(cloudBaseOptions) and injects it automatically. This mirrors what other tools like invite-code.ts, cloudrun.ts, and permissions.ts already do. (2) Layer 1 - Improve tool description: Added explicit "重要

Changed files

  • mcp/src/tools/capi.ts

… 必填参数(EnvId),且参数命名约定不 (issue_mojd35i1_ptw5mr)
@binggg
Copy link
Copy Markdown
Member Author

binggg commented Apr 29, 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-29T02:11:32.650Z

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