Skip to main content
Glama
hungryweb

CS-Cart MCP Server

by hungryweb

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
NameRequiredDescriptionDefault
notify_userNoWhether to notify the user about status change
order_idYesOrder ID
statusYesNew 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'], }, },
  • Dispatcher case in callToolRequestHandler that routes to the updateOrderStatus method.
    case 'update_order_status': return await this.updateOrderStatus(args);
  • 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) }] }; }
  • 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; }
  • 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'], },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hungryweb/cscart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server