get_warehouse
Retrieve warehouse details by ID from the ShipStation API to manage inventory locations and shipping operations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warehouseId | Yes | Warehouse ID to retrieve |
Implementation Reference
- src/tools/warehouse-tools.js:29-40 (handler)The handler function that executes the get_warehouse tool, retrieving warehouse details by ID from ShipStation API and returning formatted JSON response.handler: async ({ warehouseId }) => { try { const warehouse = await shipStationClient.getWarehouse(warehouseId); return { content: [{ type: "text", text: JSON.stringify(warehouse, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; }
- src/tools/warehouse-tools.js:26-28 (schema)Zod input schema defining the required warehouseId parameter (number) for the get_warehouse tool.schema: { warehouseId: z.number().describe("Warehouse ID to retrieve") },
- src/server.js:174-191 (registration)Registration of all tools including get_warehouse (via warehouseTools array) 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:119-121 (helper)ShipStationClient helper method called by the tool handler to fetch warehouse data via API request.async getWarehouse(warehouseId) { return this.request('GET', `/warehouses/${warehouseId}`); }