clawallex_setup
Verify API key authentication and bind agent identity to prepare the Clawallex MCP Server for payment operations and subscription management.
Instructions
Check current Clawallex connection status and ensure agent identity is bound. Calls whoami to verify API Key, then bootstrap to bind client_id if not yet bound. Use this after starting the MCP server to confirm everything is ready for payment operations. Returns: user_id, api_key_id, bound_client_id, client_id_bound status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/auth.ts:18-42 (handler)The handler function for the 'clawallex_setup' tool, which performs authentication checks and automatic bootstrapping if necessary.
async () => { try { const whoami = await client.getAuth<Record<string, unknown>>("/auth/whoami"); if (whoami.client_id_bound) { return toolOk({ status: "ready", ...whoami, _hint: `Connected. API Key bound to client_id '${whoami.bound_client_id}'.`, }); } // Not yet bound — auto-bootstrap const bootstrap = await client.postAuth<{ client_id: string; created: boolean }>("/auth/bootstrap", {}); saveClientId(client.baseUrlValue, bootstrap.client_id); client.setClientId(bootstrap.client_id); return toolOk({ status: "ready", ...whoami, bound_client_id: bootstrap.client_id, client_id_bound: true, _hint: `Connected and bound to client_id '${bootstrap.client_id}'.`, }); } catch (err) { return toolError(err); } }, - src/tools/auth.ts:8-17 (registration)Registration of the 'clawallex_setup' tool within the MCP server.
server.tool( "clawallex_setup", [ "Check current Clawallex connection status and ensure agent identity is bound.", "Calls whoami to verify API Key, then bootstrap to bind client_id if not yet bound.", "Use this after starting the MCP server to confirm everything is ready for payment operations.", "", "Returns: user_id, api_key_id, bound_client_id, client_id_bound status.", ].join(" "), {},