delete_order
Remove an order from the ShipStation API by specifying the order ID. This tool ensures accurate order management by permanently deleting the selected order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Order ID to delete |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"orderId": {
"description": "Order ID to delete",
"type": "number"
}
},
"required": [
"orderId"
],
"type": "object"
}
Implementation Reference
- src/tools/order-tools.js:109-121 (handler)The MCP tool handler for delete_order, which invokes the ShipStation API via shipStationClient to delete the specified order and returns formatted success or error response.handler: async ({ orderId }) => { try { const result = await shipStationClient.deleteOrder(orderId); 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:106-108 (schema)Zod input schema for the delete_order tool, requiring a numeric 'orderId' parameter.schema: { orderId: z.number().describe("Order ID to delete") },
- src/server.js:174-191 (registration)Registration code that includes the delete_order tool (via ...orderTools spread) and registers it along with other tools to the MCP server using server.tool().[ ...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:64-66 (helper)Helper method in ShipStationClient that performs the actual DELETE API request to ShipStation's /orders/{orderId} endpoint.async deleteOrder(orderId) { return this.request('DELETE', `/orders/${orderId}`); }