list_orders
Retrieve and filter work orders from Shopmonkey by status, customer ID, date range, or location to manage shop operations.
Instructions
List work orders from Shopmonkey. Filter by status, customer ID, date range, or location.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter by order status (e.g., estimate, work_order, invoice) | |
| customerId | No | Filter orders by customer ID | |
| locationId | No | Filter by location ID (for multi-location shops). Defaults to SHOPMONKEY_LOCATION_ID env var if set. | |
| limit | No | Maximum number of results to return (default: 25) | |
| page | No | Page number for pagination (default: 1) |
Implementation Reference
- src/tools/orders.ts:85-96 (handler)The handler implementation for the `list_orders` tool, which sanitizes input parameters, applies a default location, and makes a GET request to the Shopmonkey API.
async list_orders(args) { const params: Record<string, string> = {}; if (args.status !== undefined) params.status = String(args.status); if (args.customerId !== undefined) params.customerId = String(args.customerId); if (args.locationId !== undefined) params.locationId = String(args.locationId); if (args.limit !== undefined) params.limit = String(args.limit); if (args.page !== undefined) params.page = String(args.page); applyDefaultLocation(params); const data = await shopmonkeyRequest<Order[]>('GET', '/order', undefined, params); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/orders.ts:8-21 (schema)The tool definition and input schema for `list_orders`, specifying available filters and parameters.
{ name: 'list_orders', description: 'List work orders from Shopmonkey. Filter by status, customer ID, date range, or location.', inputSchema: { type: 'object' as const, properties: { status: { type: 'string', description: 'Filter by order status (e.g., estimate, work_order, invoice)' }, customerId: { type: 'string', description: 'Filter orders by customer ID' }, locationId: { type: 'string', description: 'Filter by location ID (for multi-location shops). Defaults to SHOPMONKEY_LOCATION_ID env var if set.' }, limit: { type: 'number', description: 'Maximum number of results to return (default: 25)' }, page: { type: 'number', description: 'Page number for pagination (default: 1)' }, }, }, },