get_account_info
Retrieve account details such as credits, plan information, and usage statistics for managing API access and monitoring resource consumption.
Instructions
Get account information including credits, plan details, and usage statistics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:343-359 (handler)The main handler function that implements the get_account_info tool. It calls the AlsoAsked API /account endpoint to fetch account details and returns a formatted text response with the account info and a summary.private async handleGetAccount() { const account: Account = await this.makeApiRequest('/account', { method: 'GET', }); return { content: [ { type: 'text', text: JSON.stringify({ accountInfo: account, summary: `Account: ${account.name} (${account.email}) - ${account.credits} credits remaining on ${account.plan} plan` }, null, 2), }, ], }; }
- src/index.ts:165-172 (registration)Registration of the get_account_info tool in the ListTools response, defining its name, description, and empty input schema.{ name: 'get_account_info', description: 'Get account information including credits, plan details, and usage statistics', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:224-225 (registration)Dispatch registration in the CallToolRequestSchema switch statement that routes calls to the get_account_info handler.case 'get_account_info': return await this.handleGetAccount();
- src/index.ts:43-49 (schema)TypeScript interface defining the structure of the account object returned by the API and used in the handler.interface Account { id: string; name: string; email: string; credits: number; plan: string; }