Skip to main content
Glama

get_inventory

Retrieve inventory data from ShipBob's fulfillment system to track stock levels, manage product availability, and monitor warehouse quantities across fulfillment centers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
limitNoNumber of items per page
fulfillmentCenterIdNoFilter by fulfillment center ID

Implementation Reference

  • The handler function that implements the core logic of the 'get_inventory' tool by fetching inventory data from ShipBob API and returning it as formatted JSON text or an error message.
    handler: async ({ page, limit, fulfillmentCenterId }) => { try { const params = { page, limit, fulfillmentCenterId }; const inventory = await shipbobClient.getInventory(params); return { content: [{ type: "text", text: JSON.stringify(inventory, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving inventory: ${error.message}` }], isError: true }; } }
  • Zod schema defining the input parameters for the 'get_inventory' tool: optional page, limit, and fulfillmentCenterId.
    schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of items per page"), fulfillmentCenterId: z.string().optional().describe("Filter by fulfillment center ID") },
  • The complete tool definition object for 'get_inventory' within the exported inventoryTools array.
    { name: "get_inventory", description: "Get inventory information across all fulfillment centers", schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of items per page"), fulfillmentCenterId: z.string().optional().describe("Filter by fulfillment center ID") }, handler: async ({ page, limit, fulfillmentCenterId }) => { try { const params = { page, limit, fulfillmentCenterId }; const inventory = await shipbobClient.getInventory(params); return { content: [{ type: "text", text: JSON.stringify(inventory, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving inventory: ${error.message}` }], isError: true }; } } },
  • src/server.js:52-52 (registration)
    Registration of the inventoryTools array (containing 'get_inventory') with the MCP server via the registerTools utility function.
    registerTools(inventoryTools);
  • ShipBobClient helper method that performs the underlying API GET request to the '/inventory' endpoint.
    async getInventory(params) { return this.request('GET', '/inventory', null, params); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mattcoatsworth/shipbob-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server