Skip to main content
Glama

update_product

Modify product details in ShipBob's system, including name, SKU, dimensions, weight, and value, by specifying the product ID and relevant attributes.

Input Schema

NameRequiredDescriptionDefault
barcodeNoProduct barcode/UPC
descriptionNoProduct description
heightNoHeight in inches
lengthNoLength in inches
nameNoProduct name
productIdYesThe ID of the product to update
skuNoStock keeping unit
valueNoDeclared value of the product
weightNoWeight in ounces
widthNoWidth in inches

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "barcode": { "description": "Product barcode/UPC", "type": "string" }, "description": { "description": "Product description", "type": "string" }, "height": { "description": "Height in inches", "type": "number" }, "length": { "description": "Length in inches", "type": "number" }, "name": { "description": "Product name", "type": "string" }, "productId": { "description": "The ID of the product to update", "type": "string" }, "sku": { "description": "Stock keeping unit", "type": "string" }, "value": { "description": "Declared value of the product", "type": "number" }, "weight": { "description": "Weight in ounces", "type": "number" }, "width": { "description": "Width in inches", "type": "number" } }, "required": [ "productId" ], "type": "object" }

Implementation Reference

  • Handler function that executes the update_product tool logic by calling the ShipBob API client to update the product and formatting the response.
    handler: async ({ productId, ...productData }) => { try { const updatedProduct = await shipbobClient.updateProduct(productId, productData); return { content: [{ type: "text", text: `Product updated successfully: ${JSON.stringify(updatedProduct, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating product: ${error.message}` }], isError: true }; }
  • Zod schema defining the input parameters for the update_product tool.
    schema: { productId: z.string().describe("The ID of the product to update"), name: z.string().optional().describe("Product name"), sku: z.string().optional().describe("Stock keeping unit"), barcode: z.string().optional().describe("Product barcode/UPC"), description: z.string().optional().describe("Product description"), weight: z.number().optional().describe("Weight in ounces"), length: z.number().optional().describe("Length in inches"), width: z.number().optional().describe("Width in inches"), height: z.number().optional().describe("Height in inches"), value: z.number().optional().describe("Declared value of the product") },
  • src/server.js:50-50 (registration)
    Registration of the productTools array to the MCP server, which includes the update_product tool.
    registerTools(productTools);
  • Helper method in ShipBobClient that performs the actual API request to update a product.
    async updateProduct(id, productData) { return this.request('PUT', `/products/${id}`, productData); }
  • Tool definition object for update_product, including name, description, schema, and handler, which is part of the productTools array registered to the MCP server.
    { name: "update_product", description: "Update an existing product in ShipBob", schema: { productId: z.string().describe("The ID of the product to update"), name: z.string().optional().describe("Product name"), sku: z.string().optional().describe("Stock keeping unit"), barcode: z.string().optional().describe("Product barcode/UPC"), description: z.string().optional().describe("Product description"), weight: z.number().optional().describe("Weight in ounces"), length: z.number().optional().describe("Length in inches"), width: z.number().optional().describe("Width in inches"), height: z.number().optional().describe("Height in inches"), value: z.number().optional().describe("Declared value of the product") }, handler: async ({ productId, ...productData }) => { try { const updatedProduct = await shipbobClient.updateProduct(productId, productData); return { content: [{ type: "text", text: `Product updated successfully: ${JSON.stringify(updatedProduct, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating product: ${error.message}` }], isError: true }; } } }

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