list_batches
Retrieve and filter batches of items in ConsignCloud by status, account, or using pagination to manage consignment operations.
Instructions
List batches of items
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results (default: 1000) | |
| cursor | No | ||
| status | No | ||
| account | No | Filter by account ID |
Implementation Reference
- src/server.ts:498-500 (handler)The MCP tool handler for 'list_batches'. It merges input arguments with a default limit of 1000, calls the client's listBatches method, stringifies the result as JSON, and returns it in the MCP response format.case 'list_batches': const batchesParams = { limit: 1000, ...(args as any) }; return { content: [{ type: 'text', text: JSON.stringify(await client.listBatches(batchesParams), null, 2) }] };
- src/server.ts:290-302 (registration)Registration of the 'list_batches' tool in the tools array returned by createTools(), including its name, description, and input schema for MCP tool listing.{ name: 'list_batches', description: 'List batches of items', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of results (default: 1000)' }, cursor: { type: 'string' }, status: { type: 'string', enum: ['draft', 'submitted'] }, account: { type: 'string', description: 'Filter by account ID' }, }, }, },
- src/server.ts:293-301 (schema)Input schema definition for the 'list_batches' tool, defining optional parameters like limit, cursor, status, and account.inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of results (default: 1000)' }, cursor: { type: 'string' }, status: { type: 'string', enum: ['draft', 'submitted'] }, account: { type: 'string', description: 'Filter by account ID' }, }, },
- src/client.ts:238-241 (helper)Client-side helper method listBatches that performs an HTTP GET request to '/batches' endpoint with provided parameters and returns the paginated response.async listBatches(params?: Record<string, any>): Promise<PaginatedResponse<Batch>> { const response = await this.client.get('/batches', { params }); return response.data; }