Skip to main content
Glama
plutzilla

Omnisend MCP Server

getCategory

Retrieve detailed product category information from Omnisend marketing platform using unique identifiers to manage product data.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for getCategory: calls API function, applies field filter, returns formatted JSON response or error.
    async (args) => { try { const response = await getCategory(args.categoryId); // Filter category data to include only defined fields const filteredCategory = filterCategoryFields(response); return { content: [ { type: "text", text: JSON.stringify(filteredCategory, 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" }] }; } }
  • Input JSON schema for getCategory tool: requires categoryId string.
    { additionalProperties: false, properties: { categoryId: { description: "Category ID", type: "string" } }, required: ["categoryId"], type: "object" },
  • Registration of the getCategory MCP tool on the server.
    server.tool(
  • Core helper function implementing the Omnisend API call to fetch a single product category by ID.
    export const getCategory = async (categoryId: string): Promise<ProductCategory> => { try { const response = await omnisendApi.get<ProductCategory>(`/product-categories/${categoryId}`); return response.data; } catch (error) { if (error instanceof Error) { throw new Error(`Error getting category information: ${error.message}`); } else { throw new Error('Unknown error occurred when getting category'); } }
  • Helper utility to filter and select specific fields from category data for tool responses.
    // Filter function for category data export const filterCategoryFields = (category: any) => { return { categoryID: category.categoryID, title: category.title, handle: category.handle, description: category.description, imageUrl: category.imageUrl, categoryUrl: category.categoryUrl, createdAt: category.createdAt, updatedAt: category.updatedAt }; };

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