list_items
Retrieve inventory items from ConsignCloud with filters for price, category, account, status, and location to manage consignment business operations.
Instructions
List inventory items with optional filters. Supports filtering by price, category, account, status, location, and more.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results to return (default: 1000) pagination is we need more | |
| cursor | No | Pagination cursor | |
| status | No | Filter by status | |
| category | No | Filter by category ID | |
| account | No | Filter by account ID | |
| location | No | Filter by location ID | |
| tag_price_gte | No | Filter items with price >= this value (in cents) | |
| tag_price_lte | No | Filter items with price <= this value (in cents) |
Implementation Reference
- src/client.ts:87-93 (handler)Core handler function that executes the list_items tool logic by querying the /items API endpoint with filters, mapping responses through conversion, and handling pagination.async listItems(params?: Record<string, any>): Promise<PaginatedResponse<Item>> { const response = await this.client.get('/items', { params }); return { data: response.data.data.map((item: any) => this.convertItemResponse(item)), next_cursor: response.data.next_cursor, }; }
- src/server.ts:428-430 (handler)MCP server handler for the list_items tool call, which prepares parameters, invokes the client listItems method, and returns a formatted text response.case 'list_items': const itemsParams = { limit: 1000, ...(args as any) }; return { content: [{ type: 'text', text: JSON.stringify(await client.listItems(itemsParams), null, 2) }] };
- src/server.ts:11-27 (schema)Tool definition including name, description, and detailed input schema (JSON Schema) for validating list_items tool parameters.{ name: 'list_items', description: 'List inventory items with optional filters. Supports filtering by price, category, account, status, location, and more.', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of results to return (default: 1000) pagination is we need more' }, cursor: { type: 'string', description: 'Pagination cursor' }, status: { type: 'string', description: 'Filter by status' }, category: { type: 'string', description: 'Filter by category ID' }, account: { type: 'string', description: 'Filter by account ID' }, location: { type: 'string', description: 'Filter by location ID' }, tag_price_gte: { type: 'number', description: 'Filter items with price >= this value (in cents)' }, tag_price_lte: { type: 'number', description: 'Filter items with price <= this value (in cents)' }, }, }, },
- src/server.ts:415-420 (registration)Registers the list_items tool (via createTools()) with the MCP server for listTools requests.const tools = createTools(); // Handle list tools request server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools, }));
- src/client.ts:400-406 (helper)Helper function to convert raw API item responses (with cents values) to the client-side Item type with proper currency formatting.private convertItemResponse(item: any): Item { return { ...item, tag_price: this.convertFromApiCents(item.tag_price), cost: item.cost ? this.convertFromApiCents(item.cost) : undefined, }; }