get_client_credits
Retrieve the current credit balance for a specific client. Input the client ID to get their available credits.
Instructions
Get client credit balance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | Yes | The client ID |
Implementation Reference
- server/index.js:780-783 (handler)Handler function for the 'get_client_credits' tool. Calls the API endpoint /v1/ai/credits/client?client_id={client_id} via GET and returns the credit balance data.
async ({ client_id }) => { const data = await apiCall(`/v1/ai/credits/client?client_id=${client_id}`, "GET"); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - server/index.js:776-778 (schema)Input schema requiring a 'client_id' string parameter described as 'The client ID'. Uses Zod for validation via z.string().describe().
{ client_id: z.string().describe("The client ID"), }, - server/index.js:773-784 (registration)Registration of the 'get_client_credits' tool on the MCP server using server.tool() with the name 'get_client_credits', description 'Get client credit balance.', title 'Get Client Credits', and readOnlyHint set to true.
server.tool( "get_client_credits", "Get client credit balance.", { client_id: z.string().describe("The client ID"), }, { title: "Get Client Credits", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ client_id }) => { const data = await apiCall(`/v1/ai/credits/client?client_id=${client_id}`, "GET"); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );