Skip to main content
Glama

get_product

Retrieve detailed product information from ShipBob's e-commerce fulfillment API by specifying the product ID. Ideal for managing inventory and fulfillment processes.

Input Schema

NameRequiredDescriptionDefault
productIdYesThe ID of the product to retrieve

Input Schema (JSON Schema)

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

Implementation Reference

  • The handler function that implements the core logic of the 'get_product' tool. It fetches the product details using shipbobClient.getProduct and returns a formatted JSON response or an error message.
    handler: async ({ productId }) => { try { const product = await shipbobClient.getProduct(productId); return { content: [{ type: "text", text: JSON.stringify(product, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving product: ${error.message}` }], isError: true }; } }
  • Zod schema defining the input parameter 'productId' for the 'get_product' tool.
    schema: { productId: z.string().describe("The ID of the product to retrieve") },
  • The complete tool definition object for 'get_product', which is part of the productTools array exported and later registered with the MCP server.
    { name: "get_product", description: "Get details of a specific product by ID", schema: { productId: z.string().describe("The ID of the product to retrieve") }, handler: async ({ productId }) => { try { const product = await shipbobClient.getProduct(productId); return { content: [{ type: "text", text: JSON.stringify(product, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving product: ${error.message}` }], isError: true }; } }
  • src/server.js:50-50 (registration)
    Registration call that registers all tools from productTools (including 'get_product') with the MCP server via server.tool().
    registerTools(productTools);
  • Helper method in ShipBobClient that performs the actual API request to retrieve a product by ID, used by the tool handler.
    async getProduct(id) { return this.request('GET', `/products/${id}`); }

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