Skip to content

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

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

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

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 tool description did not clearly state three critical constraints: (1) params must be flat key-value pairs (not nested objects), (2) almost all tcb Actions require EnvId as a top-level param, and (3) parameter names must match the official API exactly (case-sensitive). This caused the model to call CreateUser with a nested User object, missing EnvId, and using incorrect field names (UserName instead of Name, UserType instead of Type, Status instead of UserStatus).
  • changes: Modified mcp/src/tools/capi.ts — added a "重要:params 结构规则" section to the tool description with 3 explicit rules (flat structure, EnvId required, exact field names), and updated the params describe text to include a CreateUser example with correct flat structure and a note about required fields (EnvId, Name) and common naming pitfalls (Name vs UserName, Type vs UserType, UserStatus vs Status).
  • validation: TypeScript compilation (npx tsc --noEmit) passes. All 3 mandatory skill quality tests (build-skills-repo, build-compat-config, skill-quality-standards) pass (10/10). No other files reference the changed tool description text.
  • follow_up: No

Changed files

  • mcp/src/tools/capi.ts

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ae1d3cd38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mcp/src/tools/capi.ts
销毁环境时,常见做法是至少带上 \`EnvId\` 和 \`BypassCheck: true\`,如果环境已经处于隔离期再按文档补 \`IsForce: true\`。

**重要:params 结构规则**
1. params 必须是**扁平键值对**,不要嵌套对象。例如 \`CreateUser\` 的参数应写成 \`{ "EnvId": "env-xxx", "Name": "zhangsan", "Type": "internalUser", "UserStatus": "ACTIVE" }\`,而不是 \`{ "User": { "Name": "..." } }\`。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove hard ban on nested params in callCloudApi guidance

The new prompt text states that params “must be flat key-value pairs” and explicitly tells callers not to send nested objects, but multiple tcb actions in this repo’s own action index require nested structures (e.g. CreateTable.MongoConnector/PermissionInfo, EditAuthConfig.Mfa, UpdateTable.CreateIndexes). This guidance will push the model to strip required nested payloads and produce invalid API requests for those actions, so it regresses tool-call success beyond the CreateUser case.

Useful? React with 👍 / 👎.

Comment thread mcp/src/tools/capi.ts

**重要:params 结构规则**
1. params 必须是**扁平键值对**,不要嵌套对象。例如 \`CreateUser\` 的参数应写成 \`{ "EnvId": "env-xxx", "Name": "zhangsan", "Type": "internalUser", "UserStatus": "ACTIVE" }\`,而不是 \`{ "User": { "Name": "..." } }\`。
2. 几乎所有 tcb Action 都**必须**在 params 顶层携带 \`EnvId\`(环境 ID)。如果已通过 auth 工具获取了 env_id,请直接填入 params.EnvId。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid implying EnvId is required for nearly all tcb actions

The added rule says almost all tcb actions must carry top-level EnvId, but the repository’s generated action index includes actions without EnvId in their parameters (for example DescribeEnvLimit). Encouraging unconditional EnvId injection can trigger “parameter not recognized” failures on such actions, so this instruction over-constrains valid calls and can introduce avoidable call errors.

Useful? React with 👍 / 👎.

@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-29T01:31:45.313Z

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