update_order_status
Change order status in CS-Cart stores to manage fulfillment workflows, with options to notify customers about updates.
Instructions
Update order status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID | |
| status | Yes | New order status (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete) | |
| notify_user | No | Whether to notify the user about status change |
Implementation Reference
- src/index.js:524-528 (handler)The handler function that executes the tool logic: destructures the arguments to separate order_id and other data, makes a PUT request to the CS-Cart orders API endpoint, and returns the formatted JSON response.async updateOrderStatus(args) { const { order_id, ...orderData } = args; const result = await this.makeRequest('PUT', `/orders/${order_id}`, orderData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:304-323 (schema)Input schema for the tool, defining required order_id and status (with enum), and optional notify_user boolean.inputSchema: { type: 'object', properties: { order_id: { type: 'number', description: 'Order ID', }, status: { type: 'string', description: 'New order status (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete)', enum: ['O', 'P', 'C', 'F', 'D', 'B', 'I'], }, notify_user: { type: 'boolean', description: 'Whether to notify the user about status change', default: true, }, }, required: ['order_id', 'status'], },
- src/index.js:301-324 (registration)Tool registration in the ListTools response, including name, description, and full input schema.{ name: 'update_order_status', description: 'Update order status', inputSchema: { type: 'object', properties: { order_id: { type: 'number', description: 'Order ID', }, status: { type: 'string', description: 'New order status (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete)', enum: ['O', 'P', 'C', 'F', 'D', 'B', 'I'], }, notify_user: { type: 'boolean', description: 'Whether to notify the user about status change', default: true, }, }, required: ['order_id', 'status'], }, },
- src/index.js:408-409 (registration)Dispatch/registration in the CallToolRequest switch statement that calls the handler method.case 'update_order_status': return await this.updateOrderStatus(args);