list_services
Retrieve and filter service records from Shopmonkey work orders using order ID, location, or pagination parameters to manage automotive repair shop operations.
Instructions
List services on work orders in Shopmonkey.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | No | Filter services by work order ID | |
| locationId | No | Filter by location ID. 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/services.ts:47-57 (handler)The handler implementation for the list_services tool, which prepares request parameters and fetches data from the Shopmonkey API.
async list_services(args) { const params: Record<string, string> = {}; if (args.orderId !== undefined) params.orderId = String(args.orderId); 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<Service[]>('GET', '/service', undefined, params); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/services.ts:7-19 (schema)The tool definition and input schema for list_services.
{ name: 'list_services', description: 'List services on work orders in Shopmonkey.', inputSchema: { type: 'object' as const, properties: { orderId: { type: 'string', description: 'Filter services by work order ID' }, locationId: { type: 'string', description: 'Filter by location ID. 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)' }, }, }, },