Skip to main content
Glama
plutzilla

Omnisend MCP Server

updateCategory

Modify an existing product category in Omnisend by updating its details while maintaining the original structure obtained from getCategory.

Instructions

Update an existing product category. IMPORTANT: You must first get the category using getCategory and preserve the returned structure when updating.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the updateCategory MCP tool with schema, description, and thin wrapper handler that calls core update function and formats response.
    server.tool(
      "updateCategory",
      "Update an existing product category. IMPORTANT: You must first get the category using getCategory and preserve the returned structure when updating.",
      {
        additionalProperties: false,
        properties: {
          categoryId: { description: "Category ID", type: "string" },
          categoryData: { 
            additionalProperties: true,
            description: "Category data in the same structure as returned by getCategory", 
            properties: {},
            type: "object" 
          }
        },
        required: ["categoryId", "categoryData"],
        type: "object"
      },
      async (args) => {
        try {
          const response = await updateCategory(args.categoryId, 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" }] };
        }
      }
    );
  • Core handler function for updating a category via Omnisend API PUT request to /product-categories/{categoryId}.
    export const updateCategory = async (categoryId: string, categoryData: Partial<ProductCategory>): Promise<ProductCategory> => {
      try {
        const response = await omnisendApi.put<ProductCategory>(`/product-categories/${categoryId}`, categoryData);
        return response.data;
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Error updating category: ${error.message}`);
        } else {
          throw new Error('Unknown error occurred when updating category');
        }
      }
    };
  • TypeScript interface defining the ProductCategory structure used for input/output validation in updateCategory.
    export interface ProductCategory {
      categoryID: string;
      title: string;
      handle?: string;
      description?: string;
      imageUrl?: string;
      categoryUrl?: string;
      createdAt?: string;
      updatedAt?: string;
      [key: string]: unknown;
    }
  • Top-level export of the registerCategoriesTools function, which includes the updateCategory tool registration.
    export { registerCategoriesTools } from './categories/index.js';
Behavior3/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 reveals that this is a mutation operation ('Update') and specifies a required workflow (get then update with preserved structure), which adds useful context. However, it doesn't address permissions, error conditions, or what happens to unspecified fields during update.

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 perfectly concise with two sentences: one stating the purpose and one providing critical usage guidance. Every word earns its place, and the important workflow requirement is front-loaded with 'IMPORTANT:'

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does well by specifying the required workflow and structural preservation. However, it doesn't explain what the tool returns or potential side effects, leaving some gaps in completeness for an update operation.

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 the schema already fully documents the parameter situation. The description adds value by explaining that parameters should come from 'getCategory' and must 'preserve the returned structure,' providing important semantic guidance beyond the empty schema.

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 action ('Update') and resource ('an existing product category'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'replaceProduct' which might also update product-related entities, so it doesn't achieve full sibling distinction.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'You must first get the category using getCategory and preserve the returned structure when updating.' This clearly states a prerequisite workflow and distinguishes it from alternatives like createCategory or deleteCategory.

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