get_account_info
Retrieve account details such as credits, plan information, and usage stats for managing AlsoAsked API access effectively.
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 handler function for 'get_account_info' that makes an API request to '/account', retrieves the account details, and returns a formatted JSON response with account information 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:43-49 (schema)TypeScript interface defining the structure of the Account object used in the handler.interface Account { id: string; name: string; email: string; credits: number; plan: string; }
- src/index.ts:224-225 (registration)Dispatch case in the CallToolRequest handler that routes 'get_account_info' calls to the handleGetAccount method.case 'get_account_info': return await this.handleGetAccount();