whoami
Check API Key binding status to determine if it's linked to a client ID, returning bound or unbound state without modifying data.
Instructions
Query the current API Key binding status — read-only, does NOT modify any state. Returns: • client_id_bound=true → this API Key is already bound to a specific client_id. • client_id_bound=false → this API Key is not yet bound; call bootstrap to bind. Example response (bound): { "user_id": "u_123", "api_key_id": "ak_123", "status": 100, "bound_client_id": "ca_abc123", "client_id_bound": true } Example response (unbound): { "user_id": "u_123", "api_key_id": "ak_123", "status": 100, "bound_client_id": "", "client_id_bound": false }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/auth.ts:45-68 (handler)The "whoami" tool is defined and registered in src/tools/auth.ts. It calls the /auth/whoami endpoint on the client to check the API Key's binding status.
server.tool( "whoami", [ "Query the current API Key binding status — read-only, does NOT modify any state.", "Returns:", "• client_id_bound=true → this API Key is already bound to a specific client_id.", "• client_id_bound=false → this API Key is not yet bound; call bootstrap to bind.", "", "Example response (bound):", ' { "user_id": "u_123", "api_key_id": "ak_123", "status": 100, "bound_client_id": "ca_abc123", "client_id_bound": true }', "", "Example response (unbound):", ' { "user_id": "u_123", "api_key_id": "ak_123", "status": 100, "bound_client_id": "", "client_id_bound": false }', ].join(" "), {}, async () => { try { const result = await client.getAuth<unknown>("/auth/whoami"); return toolOk(result); } catch (err) { return toolError(err); } }, );