Skip to main content
Glama

get_product

Retrieve detailed product information from ShipBob's fulfillment system using a product ID to manage inventory and fulfillment operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesThe ID of the product to retrieve

Implementation Reference

  • The main handler function for the 'get_product' MCP tool. It takes a productId, calls shipbobClient.getProduct(productId), and returns the product details as JSON 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 input schema for the 'get_product' tool, defining the required 'productId' parameter as a string.
    schema: {
      productId: z.string().describe("The ID of the product to retrieve")
    },
  • src/server.js:23-32 (registration)
    Utility function that registers each tool in a tools array (like productTools containing 'get_product') to the MCP server using server.tool(name, schema, handler, description).
    const registerTools = (toolsArray) => {
      toolsArray.forEach(tool => {
        server.tool(
          tool.name,
          tool.schema,
          tool.handler,
          { description: tool.description }
        );
      });
    };
  • src/server.js:50-50 (registration)
    Specific registration call for productTools array, which includes the 'get_product' tool.
    registerTools(productTools);
  • ShipBob API client method invoked by the tool handler to perform the actual GET request to /products/{id} endpoint.
    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