list_vehicles
Retrieve vehicle records from Shopmonkey's automotive shop management system. Filter results by customer ID or location to access specific vehicle information.
Instructions
List vehicles from Shopmonkey. Filter by customer ID or location.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customerId | No | Filter vehicles by customer 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/vehicles.ts:74-84 (handler)The handler function 'list_vehicles' that executes the logic to fetch vehicles from the Shopmonkey API.
async list_vehicles(args) { const params: Record<string, string> = {}; 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<Vehicle[]>('GET', '/vehicle', undefined, params); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/vehicles.ts:7-20 (schema)The MCP tool definition for 'list_vehicles', including its name, description, and input schema.
export const definitions: Tool[] = [ { name: 'list_vehicles', description: 'List vehicles from Shopmonkey. Filter by customer ID or location.', inputSchema: { type: 'object' as const, properties: { customerId: { type: 'string', description: 'Filter vehicles by customer 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)' }, }, }, },