Skip to main content
Glama
plutzilla

Omnisend MCP Server

listContacts

Retrieve contact lists from Omnisend with pagination support, including email and phone identifiers across multiple channels.

Instructions

Retrieve a list of contacts from Omnisend. Each contact can be identified by multiple identifiers (email, phone) with corresponding channels. The response includes pagination information (next/previous cursor, limit, offset).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for listContacts: calls API helper, filters results, formats as JSON text content with error handling.
    async (args) => {
      try {
        const response = await listContacts(args);
        
        // Filter contacts data to include only defined fields
        const filteredContacts = response.contacts.map(filterContactFields);
        
        return {
          content: [
            { 
              type: "text", 
              text: JSON.stringify({
                contacts: filteredContacts,
                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" }] };
      }
    }
  • JSON Schema for listContacts tool input parameters.
    {
      additionalProperties: false,
      properties: {
        limit: { description: "Maximum number of contacts to return", type: "number" },
        offset: { description: "Skip first N results", type: "number" },
        email: { description: "Filter contacts by email address", type: "string" },
        phone: { description: "Filter contacts by phone number", type: "string" },
        status: { description: "Filter contacts by subscription status", enum: ["subscribed", "unsubscribed", "nonSubscribed"], type: "string" },
        createdAfter: { description: "Filter contacts created after specified date (ISO format)", type: "string" },
        updatedAfter: { description: "Filter contacts updated after specified date (ISO format)", type: "string" },
        tags: { description: "Filter contacts by tags", items: { type: "string" }, type: "array" }
      },
      type: "object"
    },
  • Tool registration call for listContacts using McpServer.tool() with name, description, schema, and handler.
    server.tool(
      "listContacts",
      "Retrieve a list of contacts from Omnisend. Each contact can be identified by multiple identifiers (email, phone) with corresponding channels. The response includes pagination information (next/previous cursor, limit, offset).",
      {
        additionalProperties: false,
        properties: {
          limit: { description: "Maximum number of contacts to return", type: "number" },
          offset: { description: "Skip first N results", type: "number" },
          email: { description: "Filter contacts by email address", type: "string" },
          phone: { description: "Filter contacts by phone number", type: "string" },
          status: { description: "Filter contacts by subscription status", enum: ["subscribed", "unsubscribed", "nonSubscribed"], type: "string" },
          createdAfter: { description: "Filter contacts created after specified date (ISO format)", type: "string" },
          updatedAfter: { description: "Filter contacts updated after specified date (ISO format)", type: "string" },
          tags: { description: "Filter contacts by tags", items: { type: "string" }, type: "array" }
        },
        type: "object"
      },
      async (args) => {
        try {
          const response = await listContacts(args);
          
          // Filter contacts data to include only defined fields
          const filteredContacts = response.contacts.map(filterContactFields);
          
          return {
            content: [
              { 
                type: "text", 
                text: JSON.stringify({
                  contacts: filteredContacts,
                  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 /contacts endpoint.
    export const listContacts = async (params: ListContactsParams = {}): Promise<ContactsResponse> => {
      try {
        // Pridėkime trumpą užlaikymą, kad išvengtume daug užklausų per trumpą laiką
        const response = await omnisendApi.get<ContactsResponse>('/contacts', { params });
        return response.data;
      } catch (error) {
        // Pagerinkime klaidos apdorojimą
        if (error instanceof Error) {
          throw new Error(`Error getting contacts list: ${error.message}`);
        } else {
          throw new Error('Unknown error occurred when getting contacts list');
        }
      }
    };
  • TypeScript interface defining parameters for listContacts, matching the tool schema.
    export interface ListContactsParams {
      limit?: number;
      offset?: number;
      status?: 'subscribed' | 'unsubscribed' | 'nonSubscribed';
    } 
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. It discloses that contacts have multiple identifiers and that the response includes pagination details, which is useful behavioral context. However, it doesn't mention rate limits, authentication requirements, or whether this is a read-only operation (though 'Retrieve' implies it).

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

Conciseness4/5

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

The description is two concise sentences that efficiently cover purpose and key behavioral details. It's front-loaded with the main action and avoids unnecessary elaboration, though it could be slightly more structured by separating purpose from behavioral notes.

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

Completeness3/5

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

For a list retrieval tool with no annotations and no output schema, the description provides basic purpose and pagination context but lacks details on authentication, error handling, or response format specifics. It's minimally adequate but has clear gaps given the complexity of a contact listing 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 no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on output behavior. A baseline of 4 is applied for zero-parameter tools when the schema is fully covered.

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 ('Retrieve a list') and resource ('contacts from Omnisend'), making the purpose understandable. It distinguishes from siblings like getContact (singular) and createContact (write operation), but doesn't explicitly contrast with other list tools like listCategories or listProducts.

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

Usage Guidelines3/5

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

The description implies usage for retrieving multiple contacts rather than single contacts (getContact) or creating them (createContact), but provides no explicit guidance on when to choose this tool over alternatives like listCategories or listProducts, nor any prerequisites 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