Conversation
… 必填参数(EnvId),且参数命名约定不 (issue_mojd35i1_ptw5mr)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97fa2c18fb
ℹ️ 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".
| .optional() | ||
| .describe( | ||
| "Action 对应的参数对象,键名需与官方 API 定义一致。某些 Action 需要携带 EnvId 等信息;如不确定参数结构,请先查官方文档。tcb 示例:`{ \"service\": \"tcb\", \"action\": \"DestroyEnv\", \"params\": { \"EnvId\": \"env-xxx\", \"BypassCheck\": true } }`,如果环境已经处于隔离期,可再补 `IsForce: true`;更新环境别名则可用 `{ \"service\": \"tcb\", \"action\": \"ModifyEnv\", \"params\": { \"EnvId\": \"env-xxx\", \"Alias\": \"demo\" } }`。若你的场景是通过 HTTP 协议直接集成 auth/functions/cloudrun/storage/mysqldb 等 CloudBase 业务 API,请优先使用 OpenAPI / Swagger 或 searchKnowledgeBase(mode=\"openapi\"),而不是优先使用 callCloudApi。", | ||
| "Action 对应的参数对象,键名需与官方 API 定义一致(区分大小写)。params 必须是扁平键值对,不要嵌套包装。大多数 tcb Action 需要携带 EnvId。如不确定参数结构,请先查官方文档。tcb 示例:`{ \"service\": \"tcb\", \"action\": \"DestroyEnv\", \"params\": { \"EnvId\": \"env-xxx\", \"BypassCheck\": true } }`;创建用户:`{ \"service\": \"tcb\", \"action\": \"CreateUser\", \"params\": { \"EnvId\": \"env-xxx\", \"Name\": \"zhangsan\", \"Phone\": \"13800138000\", \"Email\": \"zhangsan@example.com\", \"Type\": \"internalUser\", \"UserStatus\": \"ACTIVE\" } }`;更新环境别名:`{ \"service\": \"tcb\", \"action\": \"ModifyEnv\", \"params\": { \"EnvId\": \"env-xxx\", \"Alias\": \"demo\" } }`。若你的场景是通过 HTTP 协议直接集成 auth/functions/cloudrun/storage/mysqldb 等 CloudBase 业务 API,请优先使用 OpenAPI / Swagger 或 searchKnowledgeBase(mode=\"openapi\"),而不是优先使用 callCloudApi。", |
There was a problem hiding this comment.
Remove blanket ban on nested params
The new guidance says params “must be flat key-value pairs” and should not be nested, but this is incorrect for many valid tcb actions and will cause malformed requests when the model follows it. In this repo’s own action index, EditAuthConfig requires nested objects like Mfa/PwdUpdateStrategy, and ListTables accepts nested MongoConnector (see mcp/src/generated/tcb-action-index.ts). With the current wording, callers are pushed to flatten or omit these structures, which can break legitimate API calls.
Useful? React with 👍 / 👎.
Attribution post-PR evaluation
Cases
|
Attribution issue
Automation summary
callCloudApiMCP tool's description and params schema did not clearly communicate three critical conventions: (1) most tcb actions requireEnvIdas a top-level required parameter, (2) params must be flat key-value pairs (not nested like{"User": {...}}), and (3) parameter names must match the API exactly with correct casing (e.g.,NamenotUserName,TypenotUserType,UserStatusnotStatus). This caused the model to make its firstCreateUsercall with missingEnvId, nestedUserwrapper, and wrong parameter names, which failed.mcp/src/tools/capi.ts— added "重要参数约定" section to the tool description with three explicit rules: (1) most tcb actions requireEnvIdat params top level, (2) params must be flat (with CreateUser counter-example showing wrong nesting vs correct flat structure), (3) parameter naming must match API exactly with common confusion cases listed (NamenotUserName,TypenotUserType,UserStatusnotStatus). Also updated theparamsfield description to include aCreateUserexample with correct flat params and proper naming, and added emphasis on flat structure and case sensitivity.Changed files
mcp/src/tools/capi.ts