Skip to main content
Glama
plutzilla

Omnisend MCP Server

updateContact

Modify an existing contact's details in Omnisend by applying specific changes to the contact's stored information.

Instructions

Update an existing contact's information. IMPORTANT: You must first get the contact using getContact and preserve the returned structure when updating. The update request requires the same structure as returned by the GET method, with only your desired changes applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the updateContact tool. It calls the underlying updateContact API function with contactId and contactData, filters the response using filterContactFields, and returns the JSON stringified result or error message.
    async (args) => {
      try {
        const response = await updateContact(args.contactId, 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 updateContact tool, defining parameters contactId (string) and contactData (object).
    {
      additionalProperties: false,
      properties: {
        contactId: { description: "Contact ID", type: "string" },
        contactData: { 
          additionalProperties: true,
          description: "Contact data in the same structure as returned by getContact", 
          properties: {},
          type: "object" 
        }
      },
      required: ["contactId", "contactData"],
      type: "object"
  • Registration of the updateContact tool on the MCP server, including the tool name, description, input schema, and handler function.
    server.tool(
      "updateContact",
      "Update an existing contact's information. IMPORTANT: You must first get the contact using getContact and preserve the returned structure when updating. The update request requires the same structure as returned by the GET method, with only your desired changes applied.",
      {
        additionalProperties: false,
        properties: {
          contactId: { description: "Contact ID", type: "string" },
          contactData: { 
            additionalProperties: true,
            description: "Contact data in the same structure as returned by getContact", 
            properties: {},
            type: "object" 
          }
        },
        required: ["contactId", "contactData"],
        type: "object"
      },
      async (args) => {
        try {
          const response = await updateContact(args.contactId, 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" }] };
        }
      }
    );
  • Helper function that makes the PATCH API call to Omnisend to update a specific contact by ID.
    export const updateContact = async (contactId: string, contactData: Partial<Contact>): Promise<Contact> => {
      try {
        const response = await omnisendApi.patch<Contact>(`/contacts/${contactId}`, contactData);
        return response.data;
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Error updating contact: ${error.message}`);
        } else {
          throw new Error('Unknown error occurred when updating contact');
        }
      }
    }; 
Behavior4/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 effectively describes the mutation behavior ('update'), the required workflow (get-preserve-update), and the structural requirement (same structure as GET response). However, it doesn't mention permissions, error handling, or rate limits, which are typical gaps for mutation tools.

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 front-loaded with the purpose, followed by critical guidelines in two concise sentences. Every sentence earns its place by providing essential workflow and structural information without redundancy.

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?

Given the tool's complexity (a mutation with a specific workflow), no annotations, no output schema, and 0 parameters, the description is reasonably complete. It covers the purpose, usage prerequisites, and structural requirements. However, it lacks details on error cases or response format, which could be helpful for a mutation tool.

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 adds value by explaining the implicit parameter semantics: the update requires 'the same structure as returned by the GET method, with only your desired changes applied,' which clarifies how to construct the request body 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 tool's purpose: 'Update an existing contact's information.' It specifies the verb ('update') and resource ('contact'), though it doesn't explicitly differentiate from sibling tools like 'updateCategory' or 'replaceProduct' beyond the contact focus.

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 usage guidelines: 'You must first get the contact using getContact and preserve the returned structure when updating.' It also specifies the alternative tool ('getContact') and the prerequisite workflow, making it clear when and how to use this tool.

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