delete_warehouse
Remove a warehouse from your ShipStation account by specifying its ID, streamlining warehouse management and maintaining accurate inventory details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warehouseId | Yes | Warehouse ID to delete |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"warehouseId": {
"description": "Warehouse ID to delete",
"type": "number"
}
},
"required": [
"warehouseId"
],
"type": "object"
}
Implementation Reference
- src/tools/warehouse-tools.js:92-104 (handler)The handler function for the 'delete_warehouse' tool. It takes a warehouseId, calls shipStationClient.deleteWarehouse, and returns the result as JSON text or an error.handler: async ({ warehouseId }) => { try { const result = await shipStationClient.deleteWarehouse(warehouseId); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/warehouse-tools.js:89-91 (schema)Zod input schema for the 'delete_warehouse' tool, requiring a numeric warehouseId.schema: { warehouseId: z.number().describe("Warehouse ID to delete") },
- src/server.js:174-191 (registration)Registration of all tools including 'delete_warehouse' (from warehouseTools) 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:131-133 (helper)Supporting API client method that performs the actual DELETE request to ShipStation's /warehouses/{warehouseId} endpoint.async deleteWarehouse(warehouseId) { return this.request('DELETE', `/warehouses/${warehouseId}`); }