get_order
Retrieve detailed order information from CS-Cart stores by providing an order ID to view customer details, items, and status.
Instructions
Get detailed information about a specific order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID |
Implementation Reference
- src/index.js:519-522 (handler)The main handler function that executes the get_order tool by making a GET request to the CS-Cart API endpoint for the specific order ID.async getOrder(args) { const result = await this.makeRequest('GET', `/orders/${args.order_id}`); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:287-300 (schema)The input schema and metadata for the get_order tool, defining it requires an order_id parameter.{ name: 'get_order', description: 'Get detailed information about a specific order', inputSchema: { type: 'object', properties: { order_id: { type: 'number', description: 'Order ID', }, }, required: ['order_id'], }, },
- src/index.js:406-407 (registration)Registration in the CallToolRequestHandler switch statement that dispatches to the getOrder handler.case 'get_order': return await this.getOrder(args);
- src/index.js:288-300 (registration)Tool registration in the ListToolsRequestHandler response, listing the get_order tool with its schema.name: 'get_order', description: 'Get detailed information about a specific order', inputSchema: { type: 'object', properties: { order_id: { type: 'number', description: 'Order ID', }, }, required: ['order_id'], }, },
- src/index.js:424-440 (helper)Shared helper method used by getOrder to make authenticated API requests to CS-Cart.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; }