get_inventory_levels
Retrieve real-time inventory levels across ShipBob fulfillment centers with pagination support. Use to monitor stock quantities and optimize inventory management for e-commerce operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of items per page | |
| page | No | Page number for pagination |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"limit": {
"description": "Number of items per page",
"type": "number"
},
"page": {
"description": "Page number for pagination",
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/tools/inventory-tools.js:61-77 (handler)The handler function for the get_inventory_levels tool. It accepts pagination parameters, fetches inventory levels using shipbobClient, and returns formatted JSON or error message.handler: async ({ page, limit }) => { try { const params = { page, limit }; const levels = await shipbobClient.getInventoryLevels(params); return { content: [{ type: "text", text: JSON.stringify(levels, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving inventory levels: ${error.message}` }], isError: true }; } }
- src/tools/inventory-tools.js:57-60 (schema)Input schema using Zod for optional page and limit parameters.schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of items per page") },
- src/server.js:52-52 (registration)Registration of the inventoryTools array (containing get_inventory_levels) with the MCP server via registerTools.registerTools(inventoryTools);
- src/api-client.js:97-99 (helper)Supporting API client method that makes the HTTP request to retrieve inventory levels from the ShipBob API.async getInventoryLevels(params) { return this.request('GET', '/inventory/levels', null, params); }