list_sales
Retrieve sales data 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
| 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 for 'list_sales': constructs params with default limit 1000, calls client.listSales(), and returns JSON stringified response.
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, including properties for pagination, filtering by status, customer, location, and date ranges.
{ 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 all tools list handler, which returns the array including 'list_sales' from createTools().
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools, })); - src/client.ts:147-153 (helper)Client method listSales that proxies HTTP GET /sales with params, converts response using convertSaleResponse, returns PaginatedResponse<Sale>.
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, }; }