Skip to main content
Glama

createProduct

Add products to your Omnisend catalog with details like title, description, variants, images, and price for marketing automation.

Instructions

Create a new product in the Omnisend catalog. Product data can include details like title, description, variants, images, price, and more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'createProduct' MCP tool. Calls the API createProduct, filters response with filterProductFields, returns formatted JSON text content, handles errors.
    async (args) => { try { const response = await createProduct(args.productData); // 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" }] }; } }
  • JSON Schema defining input for 'createProduct' tool: requires 'productData' as flexible object.
    { additionalProperties: false, properties: { productData: { additionalProperties: true, description: "Product data", properties: {}, type: "object" } }, required: ["productData"], type: "object" },
  • Registration of 'createProduct' tool via server.tool(), specifying name and description.
    server.tool( "createProduct", "Create a new product in the Omnisend catalog. Product data can include details like title, description, variants, images, price, and more.",
  • API helper implementing the product creation by POSTing to Omnisend '/products' endpoint.
    export const createProduct = async (productData: Partial<Product>): Promise<Product> => { try { const response = await omnisendApi.post<Product>('/products', productData); return response.data; } catch (error) { if (error instanceof Error) { throw new Error(`Error creating product: ${error.message}`); } else { throw new Error('Unknown error occurred when creating product'); } }

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