Skip to main content
Glama

deleteProduct

Remove a product from the Omnisend catalog using its unique ID. This tool helps maintain accurate product listings by deleting outdated or unwanted items.

Instructions

Remove a product from the Omnisend catalog by its unique identifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesProduct ID

Implementation Reference

  • The MCP tool handler for deleteProduct, which calls the underlying deleteProduct API helper with the productId argument and returns a textual success or error response.
    async (args) => { try { const success = await deleteProduct(args.productId); return { content: [ { type: "text", text: success ? "Product deleted successfully" : "Failed to delete product" } ] }; } catch (error) { if (error instanceof Error) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } return { content: [{ type: "text", text: "An unknown error occurred" }] }; } } );
  • Input schema for the deleteProduct tool, specifying that a productId string is required.
    { additionalProperties: false, properties: { productId: { description: "Product ID", type: "string" } }, required: ["productId"], type: "object" },
  • Registration of the deleteProduct MCP tool via server.tool(), including name, description, input schema, and handler function.
    server.tool( "deleteProduct", "Remove a product from the Omnisend catalog by its unique identifier.", { additionalProperties: false, properties: { productId: { description: "Product ID", type: "string" } }, required: ["productId"], type: "object" }, async (args) => { try { const success = await deleteProduct(args.productId); return { content: [ { type: "text", text: success ? "Product deleted successfully" : "Failed to delete product" } ] }; } catch (error) { if (error instanceof Error) { return { content: [{ type: "text", text: `Error: ${error.message}` }] }; } return { content: [{ type: "text", text: "An unknown error occurred" }] }; } } );
  • Supporting API helper function that executes the DELETE request to Omnisend's /products/{productId} endpoint and returns true if status 204.
    export const deleteProduct = async (productId: string): Promise<boolean> => { try { const response = await omnisendApi.delete(`/products/${productId}`); return response.status === 204; } catch (error) { if (error instanceof Error) { throw new Error(`Error deleting product: ${error.message}`); } else { throw new Error('Unknown error occurred when deleting product'); } } };

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