delete_warehouse
Remove a warehouse from the ShipStation system by specifying its ID to manage shipping locations and inventory storage.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warehouseId | Yes | Warehouse ID to delete |
Implementation Reference
- src/tools/warehouse-tools.js:92-104 (handler)The async handler function that executes the delete_warehouse tool logic by calling the ShipStation API client to delete the warehouse and formatting the response or 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 schema defining the required input parameter 'warehouseId' as a number.schema: { warehouseId: z.number().describe("Warehouse ID to delete") },
- src/server.js:174-191 (registration)Registration of all tools, including those from warehouseTools (which contains delete_warehouse), by spreading the tools arrays and calling server.tool() for each 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)The ShipStationClient helper method that performs the actual DELETE HTTP request to the /warehouses/{warehouseId} API endpoint.async deleteWarehouse(warehouseId) { return this.request('DELETE', `/warehouses/${warehouseId}`); }