create_warehouse
Add new warehouse data to the ShipStation API system by submitting a JSON string, enabling efficient warehouse management and integration within the platform.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warehouseData | Yes | JSON string containing the warehouse data |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"warehouseData": {
"description": "JSON string containing the warehouse data",
"type": "string"
}
},
"required": [
"warehouseData"
],
"type": "object"
}
Implementation Reference
- src/tools/warehouse-tools.js:49-61 (handler)The async handler function that executes the create_warehouse tool logic: parses JSON input, calls the ShipStation API via client, and formats the response or error.handler: async ({ warehouseData }) => { try { const parsedData = JSON.parse(warehouseData); const result = await shipStationClient.createWarehouse(parsedData); 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:46-48 (schema)Zod input schema defining warehouseData as a JSON string parameter.schema: { warehouseData: z.string().describe("JSON string containing the warehouse data") },
- src/server.js:174-191 (registration)Registration of the warehouseTools (including create_warehouse) by spreading into the MCP server's tool registry via 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:123-125 (helper)ShipStationClient helper method that performs the actual POST request to create a warehouse via the ShipStation API.async createWarehouse(data) { return this.request('POST', '/warehouses', data); }