list_accounts
Retrieve vendor and consignor accounts from ConsignCloud with optional filters for vendor status, limits, and pagination to manage business operations.
Instructions
List vendor/consignor accounts with optional filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results (default: 1000) | |
| cursor | No | ||
| is_vendor | No | Filter by vendor status |
Implementation Reference
- src/server.ts:136-147 (schema)Defines the tool metadata including name, description, and input schema for 'list_accounts'.{ name: 'list_accounts', description: 'List vendor/consignor accounts with optional filters', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of results (default: 1000)' }, cursor: { type: 'string' }, is_vendor: { type: 'boolean', description: 'Filter by vendor status' }, }, }, },
- src/server.ts:459-461 (handler)MCP server handler for 'list_accounts' tool: prepares params, calls client.listAccounts(), formats response as JSON text.case 'list_accounts': const accountsParams = { limit: 1000, ...(args as any) }; return { content: [{ type: 'text', text: JSON.stringify(await client.listAccounts(accountsParams), null, 2) }] };
- src/client.ts:195-200 (helper)Client-side implementation: API GET /accounts with params, maps accounts via convertAccountResponse, returns paginated response.async listAccounts(params?: Record<string, any>): Promise<PaginatedResponse<Account>> { const response = await this.client.get('/accounts', { params }); return { data: response.data.data.map((account: any) => this.convertAccountResponse(account)), next_cursor: response.data.next_cursor, };
- src/client.ts:432-437 (helper)Helper to convert API account response, adjusting balance from cents to store currency.private convertAccountResponse(account: any): Account { return { ...account, balance: this.convertFromApiCents(account.balance), }; }