Skip to main content
Glama
plutzilla

Omnisend MCP Server

createCategory

Add new product categories to the Omnisend catalog with details like title, description, image, and URL for organized product management.

Instructions

Create a new product category in the Omnisend catalog. Category data can include title, description, image, and URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the createCategory MCP tool. It invokes the underlying API createCategory function, applies field filtering, formats the response as JSON text content, and handles errors appropriately.
    async (args) => {
      try {
        const response = await createCategory(args.categoryData);
        
        // 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 schema (JSON Schema) for the createCategory tool, specifying that categoryData is a required object with additional properties allowed.
    {
      additionalProperties: false,
      properties: {
        categoryData: { 
          additionalProperties: true,
          description: "Product category data", 
          properties: {},
          type: "object"
        }
      },
      required: ["categoryData"],
      type: "object"
    },
  • MCP tool registration call using server.tool() for the createCategory tool, including name, description, schema, and handler.
    server.tool(
      "createCategory",
      "Create a new product category in the Omnisend catalog. Category data can include title, description, image, and URL.",
      {
        additionalProperties: false,
        properties: {
          categoryData: { 
            additionalProperties: true,
            description: "Product category data", 
            properties: {},
            type: "object"
          }
        },
        required: ["categoryData"],
        type: "object"
      },
      async (args) => {
        try {
          const response = await createCategory(args.categoryData);
          
          // 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" }] };
        }
      }
    );
  • Helper function that performs the actual HTTP POST request to the Omnisend API to create a product category.
    export const createCategory = async (categoryData: Partial<ProductCategory>): Promise<ProductCategory> => {
      try {
        const response = await omnisendApi.post<ProductCategory>('/product-categories', categoryData);
        return response.data;
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Error creating category: ${error.message}`);
        } else {
          throw new Error('Unknown error occurred when creating category');
        }
      }
    };
  • src/index.ts:33-33 (registration)
    Invocation of registerCategoriesTools which registers the createCategory tool (among others) on the MCP server.
    registerCategoriesTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states that the tool creates a new category and lists possible data fields, but it doesn't cover critical aspects like whether this is a write operation (implied by 'create'), error handling, rate limits, or what the response looks like. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Create a new product category') and adds useful details without waste. Every word earns its place, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., permissions, side effects), response format, and error conditions, which are essential for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameters are documented in the schema. The description compensates by listing possible data fields ('title, description, image, and URL'), adding semantic meaning beyond the empty schema. However, it doesn't specify if these are required or optional, leaving some ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('create') and resource ('new product category in the Omnisend catalog'), making the purpose specific and understandable. It distinguishes from siblings like 'updateCategory' or 'deleteCategory' by focusing on creation. However, it doesn't explicitly differentiate from 'createProduct' or 'createContact' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'updateCategory' or 'listCategories', nor does it mention prerequisites such as authentication or permissions. It implies usage for creating categories but lacks explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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