update_vehicle
Modify vehicle details like year, make, model, VIN, license plate, color, and mileage in the Shopmonkey system to keep customer records current.
Instructions
Update an existing vehicle's information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The vehicle ID to update | |
| customerId | No | Customer ID to associate with the vehicle | |
| year | No | Vehicle model year | |
| make | No | Vehicle make | |
| model | No | Vehicle model | |
| vin | No | Vehicle Identification Number | |
| licensePlate | No | License plate number | |
| color | No | Vehicle color | |
| mileage | No | Current mileage |
Implementation Reference
- src/tools/vehicles.ts:98-103 (handler)The implementation of the update_vehicle tool handler, which uses shopmonkeyRequest to perform a PATCH request to the vehicle endpoint.
async update_vehicle(args) { if (!args.id) return { content: [{ type: 'text', text: 'Error: id is required' }], isError: true }; const body = pickFields(args, ALLOWED_FIELDS); const data = await shopmonkeyRequest<Vehicle>('PATCH', `/vehicle/${sanitizePathParam(String(args.id))}`, body); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; }, - src/tools/vehicles.ts:43-60 (schema)The definition and input schema for the update_vehicle tool.
{ name: 'update_vehicle', description: 'Update an existing vehicle\'s information.', inputSchema: { type: 'object' as const, properties: { id: { type: 'string', description: 'The vehicle ID to update' }, customerId: { type: 'string', description: 'Customer ID to associate with the vehicle' }, year: { type: 'number', description: 'Vehicle model year' }, make: { type: 'string', description: 'Vehicle make' }, model: { type: 'string', description: 'Vehicle model' }, vin: { type: 'string', description: 'Vehicle Identification Number' }, licensePlate: { type: 'string', description: 'License plate number' }, color: { type: 'string', description: 'Vehicle color' }, mileage: { type: 'number', description: 'Current mileage' }, }, required: ['id'], },