get_account
Retrieve account details by ID to manage consignment business operations, including vendor information and sales tracking.
Instructions
Get details of a specific account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Account ID |
Implementation Reference
- src/client.ts:203-206 (handler)Core implementation of getAccount: makes HTTP GET to /accounts/{id} and converts the API response to typed Account.async getAccount(id: string): Promise<Account> { const response = await this.client.get(`/accounts/${id}`); return this.convertAccountResponse(response.data); }
- src/server.ts:148-158 (registration)MCP tool registration defining the 'get_account' tool, its description, and input schema.{ name: 'get_account', description: 'Get details of a specific account', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Account ID' }, }, required: ['id'], }, },
- src/server.ts:463-464 (handler)Server-side tool execution handler that dispatches to client.getAccount and formats response as MCP content.case 'get_account': return { content: [{ type: 'text', text: JSON.stringify(await client.getAccount((args as any).id), null, 2) }] };
- src/types.ts:35-48 (schema)TypeScript interface defining the Account output type returned by getAccount.export interface Account { id: string; number: string; first_name: string | null; last_name: string | null; company: string | null; email: string | null; phone_number: string | null; balance: number; // converted to store currency default_split: number; default_inventory_type: 'consignment' | 'buy_outright' | 'retail'; is_vendor: boolean; created: string; }
- src/client.ts:432-437 (helper)Helper function to convert raw API account response (with cents) to typed Account with store currency.private convertAccountResponse(account: any): Account { return { ...account, balance: this.convertFromApiCents(account.balance), }; }