Skip to main content
Glama

ShipBob API MCP Server

inventory-tools.js4.02 kB
import { z } from 'zod'; import { shipbobClient } from '../api-client.js'; export const inventoryTools = [ { 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 }; } } }, { name: "get_product_inventory", description: "Get inventory information for a specific product", schema: { productId: z.string().describe("The ID of the product to check inventory for") }, 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 }; } } }, { name: "get_inventory_levels", description: "Get current inventory levels for all products", schema: { page: z.number().optional().describe("Page number for pagination"), limit: z.number().optional().describe("Number of items per page") }, 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 }; } } }, { name: "adjust_inventory", description: "Make an inventory adjustment for a product", schema: { productId: z.string().describe("The ID of the product to adjust"), fulfillmentCenterId: z.string().describe("The ID of the fulfillment center"), quantity: z.number().describe("Quantity to adjust (positive for addition, negative for reduction)"), reason: z.string().describe("Reason for the adjustment") }, handler: async ({ productId, fulfillmentCenterId, quantity, reason }) => { try { const adjustmentData = { productId, fulfillmentCenterId, quantity, reason }; const result = await shipbobClient.adjustInventory(adjustmentData); return { content: [{ type: "text", text: `Inventory adjusted successfully: ${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error adjusting inventory: ${error.message}` }], isError: true }; } } } ];

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