Skip to main content
Glama
plutzilla

Omnisend MCP Server

createContact

Add or update customer profiles in Omnisend marketing platform with email, phone, subscription status, and custom data.

Instructions

Create or update a contact in Omnisend. Contact data can include identifiers (email, phone), personal information, subscription status, and custom properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline handler function for the createContact MCP tool. It calls the createOrUpdateContact API wrapper, filters the response using filterContactFields, and returns JSON stringified result or error.
    async (args) => {
      try {
        const response = await createOrUpdateContact(args.contactData);
        
        // Filter contact data to include only defined fields
        const filteredContact = filterContactFields(response);
        
        return {
          content: [
            { 
              type: "text", 
              text: JSON.stringify(filteredContact, 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 for the createContact tool, defining contactData as an open object.
    {
      additionalProperties: false,
      properties: {
        contactData: { 
          additionalProperties: true,
          description: "Contact data", 
          properties: {},
          type: "object"
        }
      },
      required: ["contactData"],
      type: "object"
    },
  • Registration of the createContact tool using server.tool(), including name, description, input schema, and handler function.
    server.tool(
      "createContact",
      "Create or update a contact in Omnisend. Contact data can include identifiers (email, phone), personal information, subscription status, and custom properties.",
      {
        additionalProperties: false,
        properties: {
          contactData: { 
            additionalProperties: true,
            description: "Contact data", 
            properties: {},
            type: "object"
          }
        },
        required: ["contactData"],
        type: "object"
      },
      async (args) => {
        try {
          const response = await createOrUpdateContact(args.contactData);
          
          // Filter contact data to include only defined fields
          const filteredContact = filterContactFields(response);
          
          return {
            content: [
              { 
                type: "text", 
                text: JSON.stringify(filteredContact, 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" }] };
        }
      }
    );
  • API wrapper function that performs the POST request to Omnisend /contacts endpoint to create or update a contact.
    export const createOrUpdateContact = async (contactData: Partial<Contact>): Promise<Contact> => {
      try {
        const response = await omnisendApi.post<Contact>('/contacts', contactData);
        return response.data;
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Error creating contact: ${error.message}`);
        } else {
          throw new Error('Unknown error occurred when creating contact');
        }
      }
    };
  • Helper function to filter contact object to specific allowed fields before returning in tool response.
    export const filterContactFields = (contact: any) => {
      return {
        contactID: contact.contactID,
        email: contact.email,
        phone: contact.phone,
        firstName: contact.firstName,
        lastName: contact.lastName,
        status: contact.status,
        tags: contact.tags,
        identifiers: contact.identifiers,
        createdAt: contact.createdAt,
        updatedAt: contact.updatedAt,
        // Include added fields
        country: contact.country,
        state: contact.state,
        city: contact.city,
        gender: contact.gender,
        birthdate: contact.birthdate
      };
    }; 
  • TypeScript interface defining the structure of a Contact object, used in API calls and filtering.
    export interface Contact {
      contactID: string;
      email?: string;
      phone?: string;
      firstName?: string;
      lastName?: string;
      status?: string;
      tags?: string[];
      identifiers?: ContactIdentifier[];
      createdAt?: string;
      updatedAt?: string;
      country?: string;
      state?: string;
      city?: string;
      gender?: string;
      birthdate?: string;
      [key: string]: unknown;
    }
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 the tool 'create[s] or update[s] a contact,' implying a mutation operation, but doesn't disclose critical traits like required permissions, whether it's idempotent, error handling, or rate limits. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 appropriately concise with two sentences: the first states the purpose, and the second details the data scope. It's front-loaded with the core function and avoids unnecessary words. However, it could be slightly more structured by explicitly separating creation and update scenarios.

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?

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is minimally adequate. It covers the purpose and data scope but lacks details on behavioral traits, usage context, and output expectations. For a mutation tool, this leaves gaps in completeness, though the parameter semantics are well-handled.

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 fully documents the lack of parameters. The description adds value by specifying what data can be included ('identifiers, personal information, subscription status, and custom properties'), which provides semantic context beyond the empty schema. This compensates well for the parameter-less design.

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 tool's purpose: 'Create or update a contact in Omnisend.' It specifies the verb ('create or update') and resource ('contact'), and distinguishes it from siblings like 'getContact' or 'listContacts' by indicating it's a write operation. However, it doesn't explicitly differentiate from 'updateContact' (a sibling tool), which slightly reduces clarity.

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. It doesn't mention when to choose 'createContact' over 'updateContact' (a sibling), nor does it specify prerequisites or contexts for use. The lack of usage guidelines leaves the agent without direction on tool selection.

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