Skip to main content
Glama

adjust_inventory

Update inventory levels for specific products in ShipBob fulfillment centers by adjusting quantities with a given reason, ensuring accurate stock management.

Input Schema

NameRequiredDescriptionDefault
fulfillmentCenterIdYesThe ID of the fulfillment center
productIdYesThe ID of the product to adjust
quantityYesQuantity to adjust (positive for addition, negative for reduction)
reasonYesReason for the adjustment

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "fulfillmentCenterId": { "description": "The ID of the fulfillment center", "type": "string" }, "productId": { "description": "The ID of the product to adjust", "type": "string" }, "quantity": { "description": "Quantity to adjust (positive for addition, negative for reduction)", "type": "number" }, "reason": { "description": "Reason for the adjustment", "type": "string" } }, "required": [ "productId", "fulfillmentCenterId", "quantity", "reason" ], "type": "object" }

Implementation Reference

  • The asynchronous handler function that implements the core logic for the 'adjust_inventory' tool. It constructs adjustment data from inputs and delegates to shipbobClient.adjustInventory, returning formatted success or error responses.
    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 }; }
  • Zod-based input schema defining the required parameters for the adjust_inventory tool: productId (string), fulfillmentCenterId (string), quantity (number), reason (string).
    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") },
  • src/server.js:50-58 (registration)
    Registration calls that invoke registerTools(inventoryTools), which registers the 'adjust_inventory' tool (among others) with the MCP server via server.tool(name, schema, handler).
    registerTools(productTools); registerTools(orderTools); registerTools(inventoryTools); registerTools(fulfillmentTools); registerTools(webhookTools); registerTools(returnTools); registerTools(locationTools); registerTools(channelTools); registerTools(reportingTools);
  • Helper method in ShipBobClient that performs the actual HTTP POST request to the ShipBob API endpoint '/inventory/adjustments' with the adjustment data.
    async adjustInventory(adjustmentData) { return this.request('POST', '/inventory/adjustments', adjustmentData); }

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