list_labor
Retrieve labor line items from Shopmonkey to track technician work on orders, with filtering by work order ID, location, and pagination controls.
Instructions
List labor line items from Shopmonkey. Useful for tracking technician work on orders.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | No | Filter labor entries 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/labor.ts:62-72 (handler)The implementation of the 'list_labor' tool handler, which processes input arguments and makes a request to the Shopmonkey API.
async list_labor(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<Labor[]>('GET', '/labor', undefined, params); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/labor.ts:7-19 (schema)The MCP tool definition and input schema for 'list_labor'.
{ name: 'list_labor', description: 'List labor line items from Shopmonkey. Useful for tracking technician work on orders.', inputSchema: { type: 'object' as const, properties: { orderId: { type: 'string', description: 'Filter labor entries 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)' }, }, }, },