list_accounts
Retrieve vendor and consignor accounts from ConsignCloud with optional filters for vendor status and pagination controls.
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 (registration)Tool registration 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 that dispatches list_accounts tool calls to the client.listAccounts methodcase '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-201 (handler)Core implementation of list_accounts: fetches accounts from API /accounts endpoint, converts responses, handles paginationasync 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 function to convert API account response, specifically handling currency conversion for balanceprivate convertAccountResponse(account: any): Account { return { ...account, balance: this.convertFromApiCents(account.balance), }; }
- src/types.ts:48-80 (schema)Type definitions for PaginatedResponse and Account used as output schema for list_accounts} export interface Batch { id: string; created: string; status: 'submitted' | 'draft'; platform_editing_on: 'portal' | 'consigncloud'; number: string; description: string | null; account: string | null; } export interface ItemCategory { id: string; name: string; created: string; deleted: string | null; } export interface Location { id: string; name: string; address_line_1: string | null; address_line_2: string | null; city: string | null; state: string | null; postal_code: string | null; } export interface PaginatedResponse<T> { data: T[]; next_cursor: string | null; }