Skip to main content
Glama

get_product_inventory

Retrieve real-time inventory data for a specific product using its ID, enabling accurate stock management via the ShipBob API MCP Server.

Input Schema

NameRequiredDescriptionDefault
productIdYesThe ID of the product to check inventory for

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "productId": { "description": "The ID of the product to check inventory for", "type": "string" } }, "required": [ "productId" ], "type": "object" }

Implementation Reference

  • The async handler function that executes the tool logic: fetches product inventory via shipbobClient and returns JSON response or error.
    handler: async ({ productId }) => { try { const inventory = await shipbobClient.getInventoryByProduct(productId); return { content: [{ type: "text", text: JSON.stringify(inventory, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving product inventory: ${error.message}` }], isError: true }; } } },
  • Zod input schema defining the required productId parameter.
    schema: { productId: z.string().describe("The ID of the product to check inventory for") },
  • src/server.js:52-52 (registration)
    Calls registerTools with inventoryTools array, which registers the get_product_inventory tool (along with others) to the MCP server.
    registerTools(inventoryTools);
  • ShipBobClient method supporting the handler by making the API request to retrieve inventory for the given product ID.
    async getInventoryByProduct(productId) { return this.request('GET', `/inventory/products/${productId}`); }

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