Skip to main content
Glama

get_product_inventory

Retrieve current stock levels for a specific product in the ShipBob fulfillment system to manage inventory and prevent overselling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesThe ID of the product to check inventory for

Implementation Reference

  • The main handler function for the 'get_product_inventory' tool. It fetches inventory data for a specific product using shipbobClient and returns formatted JSON or an error response.
    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 }; }
  • Input schema for the tool using Zod, requiring a productId string.
    schema: { productId: z.string().describe("The ID of the product to check inventory for") },
  • src/server.js:52-52 (registration)
    Registers the inventoryTools array (which includes get_product_inventory) with the MCP server using the generic registerTools function.
    registerTools(inventoryTools);
  • src/server.js:3-6 (registration)
    Imports inventoryTools from tools/index.js, which re-exports from inventory-tools.js.
    import { productTools, orderTools, inventoryTools,
  • src/tools/index.js:3-3 (registration)
    Re-exports inventoryTools for convenient import in server.js.
    export { inventoryTools } from './inventory-tools.js';

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