create_order
Submit order data to the ShipStation API via a structured JSON input to create and manage orders efficiently within the ShipStation system.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderData | Yes | JSON string containing the order data |
Implementation Reference
- src/tools/order-tools.js:60-73 (handler)The handler function for the create_order tool. Parses the JSON orderData and calls shipStationClient.createOrder, returning the result as formatted JSON or an error message.handler: async ({ orderData }) => { try { const parsedData = JSON.parse(orderData); const result = await shipStationClient.createOrder(parsedData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/order-tools.js:57-59 (schema)Zod schema defining the input: a JSON string for orderData.schema: { orderData: z.string().describe("JSON string containing the order data") },
- src/server.js:173-191 (registration)Registration of all tools, including create_order from orderTools, using the MCP server's tool() method.// 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:56-58 (helper)Helper method in ShipStationClient that performs the actual API call to create an order via POST /orders/createorder.async createOrder(orderData) { return this.request('POST', '/orders/createorder', orderData); }
- src/tools/order-tools.js:55-56 (schema)Full tool definition including name, description, and schema for create_order.name: "create_order", description: "Create a new order in ShipStation",