list_sales
Retrieve sales records from ConsignCloud with filters for status, customer, location, date range, and pagination to manage consignment business operations.
Instructions
List sales with optional filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results (default: 1000) | |
| cursor | No | Pagination cursor | |
| status | No | Filter by status (completed, voided, returned) | |
| customer | No | Filter by customer account ID | |
| location | No | Filter by location ID | |
| created_gte | No | Filter sales created after this date (ISO 8601) | |
| created_lte | No | Filter sales created before this date (ISO 8601) |
Implementation Reference
- src/server.ts:449-451 (handler)MCP tool handler execution logic for 'list_sales' tool, which delegates to client.listSales after adding default limit.case 'list_sales': const salesParams = { limit: 1000, ...(args as any) }; return { content: [{ type: 'text', text: JSON.stringify(await client.listSales(salesParams), null, 2) }] };
- src/server.ts:98-113 (schema)Input schema definition for the 'list_sales' tool, defining parameters like limit, cursor, status, etc.{ name: 'list_sales', description: 'List sales with optional filters', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of results (default: 1000)' }, cursor: { type: 'string', description: 'Pagination cursor' }, status: { type: 'string', description: 'Filter by status (completed, voided, returned)' }, customer: { type: 'string', description: 'Filter by customer account ID' }, location: { type: 'string', description: 'Filter by location ID' }, created_gte: { type: 'string', description: 'Filter sales created after this date (ISO 8601)' }, created_lte: { type: 'string', description: 'Filter sales created before this date (ISO 8601)' }, }, }, },
- src/server.ts:418-420 (registration)Registration of tools list handler which returns the createTools() array including 'list_sales' tool.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools, }));
- src/client.ts:147-153 (helper)Core implementation of listSales method in ConsignCloudClient, performing API GET request to /sales endpoint and processing response.async listSales(params?: Record<string, any>): Promise<PaginatedResponse<Sale>> { const response = await this.client.get('/sales', { params }); return { data: response.data.data.map((sale: any) => this.convertSaleResponse(sale)), next_cursor: response.data.next_cursor, }; }