Skip to main content
Glama

get_inventory

Retrieve inventory data from ShipBob's fulfillment API by specifying page, limit, and fulfillment center ID for efficient stock management.

Input Schema

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "fulfillmentCenterId": { "description": "Filter by fulfillment center ID", "type": "string" }, "limit": { "description": "Number of items per page", "type": "number" }, "page": { "description": "Page number for pagination", "type": "number" } }, "type": "object" }

Implementation Reference

  • The handler function that implements the core logic of the 'get_inventory' tool. It constructs parameters, calls the ShipBob API via shipbobClient.getInventory, formats the response as JSON text, and handles errors.
    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 for pagination, and fulfillmentCenterId filter.
    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") },
  • src/server.js:52-52 (registration)
    Calls registerTools on inventoryTools, which iterates over the tools array (including 'get_inventory') and registers each with the MCP server using server.tool(name, schema, handler).
    registerTools(inventoryTools);
  • ShipBobClient method called by the tool handler to fetch inventory data from the ShipBob API endpoint '/inventory'.
    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