get_order
Retrieve detailed order information from the ShipStation API by specifying the order ID using the structured MCP server tool.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Order ID to retrieve |
Implementation Reference
- src/tools/order-tools.js:40-52 (handler)The main handler function for the 'get_order' MCP tool. It takes orderId, fetches the order via shipStationClient.getOrder(), formats as JSON text response, or returns error.handler: async ({ orderId }) => { try { const order = await shipStationClient.getOrder(orderId); return { content: [{ type: "text", text: JSON.stringify(order, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/order-tools.js:37-39 (schema)Zod schema defining the input for 'get_order': a required numeric orderId.schema: { orderId: z.number().describe("Order ID to retrieve") },
- src/server.js:173-191 (registration)MCP server registration loop that includes 'get_order' from orderTools array, calling server.tool(name, schema, handler) for each.// Register all tools [ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:52-54 (helper)Helper method in shipStationClient that performs the HTTP GET request to /orders/{orderId} to retrieve order details.async getOrder(orderId) { return this.request('GET', `/orders/${orderId}`); }