Skip to main content
Glama
plutzilla

Omnisend MCP Server

listCategories

Retrieve paginated product categories from the Omnisend catalog to manage and organize e-commerce inventory.

Instructions

Retrieve a list of product categories from the Omnisend catalog with pagination support. The response includes pagination information (next/previous cursor, limit, offset).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the "listCategories" MCP tool. It calls the underlying API function, filters the categories using filterCategoryFields, formats the response as JSON, and handles errors by returning error text content.
    async (args) => {
      try {
        const response = await listCategories(args);
        
        // Filter categories data to include only defined fields
        const filteredCategories = response.categories.map(filterCategoryFields);
        
        return {
          content: [
            { 
              type: "text", 
              text: JSON.stringify({
                categories: filteredCategories,
                paging: response.paging
              }, 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" }] };
      }
    }
  • The JSON schema defining the input parameters for the listCategories tool: optional limit and offset for pagination.
    {
      additionalProperties: false,
      properties: {
        limit: { description: "Maximum number of categories to return", type: "number" },
        offset: { description: "Skip first N results", type: "number" }
      },
      type: "object"
    },
  • The registration of the "listCategories" tool using McpServer.tool(), including name, description, input schema, and handler function.
    server.tool(
      "listCategories",
      "Retrieve a list of product categories from the Omnisend catalog with pagination support. The response includes pagination information (next/previous cursor, limit, offset).",
      {
        additionalProperties: false,
        properties: {
          limit: { description: "Maximum number of categories to return", type: "number" },
          offset: { description: "Skip first N results", type: "number" }
        },
        type: "object"
      },
      async (args) => {
        try {
          const response = await listCategories(args);
          
          // Filter categories data to include only defined fields
          const filteredCategories = response.categories.map(filterCategoryFields);
          
          return {
            content: [
              { 
                type: "text", 
                text: JSON.stringify({
                  categories: filteredCategories,
                  paging: response.paging
                }, 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 API call to Omnisend's /product-categories endpoint, used by the tool handler.
    export const listCategories = async (params: ListCategoriesParams = {}): Promise<CategoriesResponse> => {
      try {
        const response = await omnisendApi.get<CategoriesResponse>('/product-categories', { params });
        return response.data;
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Error getting categories list: ${error.message}`);
        } else {
          throw new Error('Unknown error occurred when getting categories list');
        }
      }
    };
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 helpfully describes the pagination behavior and response structure, which is valuable context beyond basic functionality. However, it doesn't mention potential rate limits, authentication requirements, error conditions, or whether this operation is safe/read-only (though implied by 'Retrieve').

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 that each earn their place: the first states the core functionality, the second provides crucial behavioral detail about pagination. No wasted words, and the most important information (what the tool does) is front-loaded.

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 read-only list operation with no parameters and no output schema, the description provides good coverage of what the tool does and its pagination behavior. However, without annotations or output schema, it could benefit from mentioning the expected response format beyond just pagination metadata, and clarifying any authentication or rate limit considerations.

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 appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's behavior and output. This meets the baseline expectation for zero-parameter tools.

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

Purpose5/5

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

The description clearly states the specific action ('Retrieve a list'), resource ('product categories from the Omnisend catalog'), and scope ('with pagination support'). It explicitly distinguishes this from sibling tools like getCategory (singular retrieval) and listProducts/Contacts (different resource types).

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

Usage Guidelines4/5

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

The description provides clear context about retrieving paginated lists of product categories, which implicitly suggests using this for bulk retrieval rather than getCategory for single items. However, it doesn't explicitly state when NOT to use this tool or name specific alternatives among siblings like listProducts or listContacts for different resource types.

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