get_warehouse
Retrieve detailed warehouse information from the ShipStation API using the specified warehouse ID. Facilitates efficient management of warehouse-related data for streamlined operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warehouseId | Yes | Warehouse ID to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"warehouseId": {
"description": "Warehouse ID to retrieve",
"type": "number"
}
},
"required": [
"warehouseId"
],
"type": "object"
}
Implementation Reference
- src/tools/warehouse-tools.js:29-41 (handler)The handler function that executes the tool logic: fetches the warehouse using shipStationClient.getWarehouse and returns formatted MCP content or error 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)Input schema using Zod to validate the warehouseId parameter.schema: { warehouseId: z.number().describe("Warehouse ID to retrieve") },
- src/server.js:184-191 (registration)Registration of the get_warehouse tool (spread from warehouseTools array at line 178) with the MCP server via server.tool call in this loop.].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:119-121 (helper)Supporting API client method that performs the actual HTTP request to the ShipStation /warehouses/{warehouseId} endpoint.async getWarehouse(warehouseId) { return this.request('GET', `/warehouses/${warehouseId}`); }