Get balance
get_balanceCheck your SocialRouter credit balance to monitor remaining API usage.
Instructions
Check your SocialRouter credit balance
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:59-70 (handler)The 'get_balance' tool handler: defines the tool registration with an empty input schema and a handler that calls client.getBalance() and returns a formatted balance string.
server.registerTool( "get_balance", { title: "Get balance", description: "Check your SocialRouter credit balance", inputSchema: {}, }, async () => { const balance = await client.getBalance(); return { content: [{ type: "text" as const, text: `Balance: $${balance.balance.toFixed(2)} ${balance.currency}` }] }; } ); - src/index.ts:59-70 (registration)The 'get_balance' tool is registered via server.registerTool at line 59.
server.registerTool( "get_balance", { title: "Get balance", description: "Check your SocialRouter credit balance", inputSchema: {}, }, async () => { const balance = await client.getBalance(); return { content: [{ type: "text" as const, text: `Balance: $${balance.balance.toFixed(2)} ${balance.currency}` }] }; } ); - src/index.ts:62-64 (schema)Input schema for 'get_balance': empty object (no parameters), with title and description metadata.
title: "Get balance", description: "Check your SocialRouter credit balance", inputSchema: {},