Skip to main content
Glama

getProduct

Retrieve detailed product information using a unique product ID to access specific data through the Omnisend MCP Server for marketing platform integration.

Instructions

Retrieve detailed information about a specific product by its unique identifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesProduct ID

Implementation Reference

  • The handler function that executes the 'getProduct' MCP tool logic. It calls the underlying API function, filters the product fields, formats the response as JSON, and handles errors.
    async (args) => { try { const response = await getProduct(args.productId); // Filter product data to include only defined fields const filteredProduct = filterProductFields(response); return { content: [ { type: "text", text: JSON.stringify(filteredProduct, null, 2) } ] }; } catch (error) { if (error instanceof Error) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } return { content: [{ type: "text", text: "An unknown error occurred" }] }; } }
  • The JSON Schema defining the input parameters for the 'getProduct' tool, which requires a 'productId' string.
    { additionalProperties: false, properties: { productId: { description: "Product ID", type: "string" } }, required: ["productId"], type: "object"
  • The server.tool() call that registers the 'getProduct' MCP tool on the server, providing name, description, input schema, and handler.
    server.tool( "getProduct", "Retrieve detailed information about a specific product by its unique identifier.", { additionalProperties: false, properties: { productId: { description: "Product ID", type: "string" } }, required: ["productId"], type: "object" }, async (args) => { try { const response = await getProduct(args.productId); // Filter product data to include only defined fields const filteredProduct = filterProductFields(response); return { content: [ { type: "text", text: JSON.stringify(filteredProduct, null, 2) } ] }; } catch (error) { if (error instanceof Error) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } return { content: [{ type: "text", text: "An unknown error occurred" }] }; } } );
  • Supporting utility function 'getProduct' that makes the HTTP GET request to the Omnisend API to fetch product details by ID, used by the MCP tool handler.
    export const getProduct = async (productId: string): Promise<Product> => { try { const response = await omnisendApi.get<Product>(`/products/${productId}`); return response.data; } catch (error) { if (error instanceof Error) { throw new Error(`Error getting product information: ${error.message}`); } else { throw new Error('Unknown error occurred when getting product'); } } };
  • src/index.ts:31-35 (registration)
    High-level registration calls for all tool sets on the MCP server, including registerProductsTools which registers 'getProduct' among others.
    registerContactsTools(server); registerProductsTools(server); registerCategoriesTools(server); registerEventsTools(server); registerBrandsTools(server);

Other Tools

Related Tools

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/plutzilla/omnisend-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server