Skip to content

Commit e0ecdfa

Browse files
author
CodeBuddy Attribution Bot
committed
fix(attribution): callCloudApi return structure is nested and hard to parse (issue_mojeslnq_ph73yy)
1 parent e2ca73f commit e0ecdfa

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

doc/prompts/auth-web.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,9 @@ If the current task has not retrieved a real Publishable Key, omit `accessKey` i
143143

144144
**1. Phone OTP (Recommended)**
145145
- Automatically use `auth-tool-cloudbase` to turn on `SMS Login` through `manageAppAuth`
146-
- Send the phone number to `auth.signInWithOtp({ phone, ... })`, then call the returned `verifyOtp({ token })`.
147-
- `signInWithOtp` can automatically create a new user if the user does not exist; control this via `shouldCreateUser` parameter (default `true`).
146+
- For phone registration, send the phone number to `auth.signUp({ phone, ... })` first, then call the returned `verifyOtp({ token })`. Do not swap the order.
148147
```js
149-
const { data, error } = await auth.signInWithOtp({ phone: '13800138000' })
148+
const { data, error } = await auth.signUp({ phone: '13800138000' })
150149
const { data: loginData, error: loginError } = await data.verifyOtp({ token:'123456' })
151150
```
152151

mcp/src/tools/capi.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,18 @@ export function registerCapiTools(server: ExtendedMcpServer) {
270270
}
271271
logCloudBaseResult(logger, result);
272272

273+
// Normalize result to a consistent envelope structure for easier parsing
274+
const normalizedResult = {
275+
success: true,
276+
data: result ?? {},
277+
message: `${service}/${action} 调用成功`,
278+
};
279+
273280
return {
274281
content: [
275282
{
276283
type: "text",
277-
text: JSON.stringify(
278-
result,
279-
null,
280-
2,
281-
),
284+
text: JSON.stringify(normalizedResult, null, 2),
282285
},
283286
],
284287
};

0 commit comments

Comments
 (0)