update_order_status
Modify the status of an order in CS-Cart MCP Server by specifying the order ID, new status, and optional user notification for tracking and managing e-commerce transactions efficiently.
Instructions
Update order status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notify_user | No | Whether to notify the user about status change | |
| order_id | Yes | Order ID | |
| status | Yes | New order status (O=Open, P=Processed, C=Complete, F=Failed, D=Declined, B=Backordered, I=Incomplete) |
Implementation Reference
- src/index.js:301-324 (registration)Tool registration in the listTools response, including name, description, and 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 (handler)Dispatcher case in callToolRequestHandler that routes to the updateOrderStatus method.case 'update_order_status': return await this.updateOrderStatus(args);
- src/index.js:524-528 (handler)Core handler function: destructures args to get order_id and passes rest as data in PUT request to /orders/{order_id} via makeRequest helper, returns 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:424-440 (helper)Shared helper method used by all tools to make authenticated API requests to CS-Cart backend using axios.async makeRequest(method, endpoint, data = null) { const config = { method, url: `${process.env.CSCART_API_URL}${endpoint}`, headers: { 'Content-Type': 'application/json', 'Authorization': `Basic ${Buffer.from(`${process.env.CSCART_API_EMAIL}:${process.env.CSCART_API_KEY}`).toString('base64')}`, }, }; if (data) { config.data = data; } const response = await axios(config); return response.data; }
- src/index.js:304-323 (schema)Input schema defining parameters for the update_order_status tool.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'], },