Skip to main content
Glama

unsubscribeContact

Remove or suppress a contact from Mailmodo’s email campaigns by specifying their email address, ensuring compliance with unsubscribe requests.

Instructions

Unsubscribe or supress contact in mailmodo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYes

Implementation Reference

  • src/server.ts:243-272 (registration)
    Registration of the MCP tool 'unsubscribeContact' including inline input schema (email: z.string()) and handler wrapper that invokes the core unsubscribeContact function.
    server.tool(
      "unsubscribeContact",
      "Unsubscribe or supress contact in mailmodo",
      {
          email: z.string()
      },
      async (params) => {
        try {
          const respone = await unsubscribeContact(mmApiKey,params.email);
          
          // Here you would typically integrate with your event sending system
          // For example: eventBus.emit(eventName, eventData)
          
          // For demonstration, we'll just return a success message
          return {
            content: [{
              type: "text",
              text: respone.success ?`Successfully unsubscribed '${params.email} with message ${respone.message}.`: `Something went wrong. Please check if the email is correct`,
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: error instanceof Error ? error.message : "Failed to unsubscribe",
            }],
            isError: true
          };
        }
      }
  • Core handler function that performs the HTTP POST request to Mailmodo's unsubscribe endpoint, handling errors and returning the response.
    export async function unsubscribeContact(
        mmApiKey: string,
        email: string
    ): Promise<AddContactToListResponse> {
        if (!email) {
            throw new Error('Email is a required field');
        }
    
        try {
            const response = await axios.post<AddContactToListResponse>(
                'https://api.mailmodo.com/api/v1/contacts/unsubscribe',
                {
                    email,
                },
                {
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/json',
                        'mmApiKey': mmApiKey || ''
                    }
                }
            );
    
            return response.data;
        } catch (error) {
            if (error instanceof AxiosError) {
                return {
                    success: false,
                    message: error.response?.data?.message || 'Failed to unsubscribe contact'
                };
            }
            throw new Error('An unexpected error occurred');
        }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'unsubscribe or suppress' implies a mutation operation, it doesn't specify whether this action is reversible, what permissions are required, whether it affects email delivery immediately, or what the response looks like. Significant behavioral context is missing.

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 a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential information without unnecessary elaboration.

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

Completeness2/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, no output schema, and 0% schema description coverage, the description is insufficient. It doesn't explain what 'suppress' means operationally, whether the action is permanent or temporary, what confirmation or error responses to expect, or how this differs from similar sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter information beyond what's in the schema (which has 0% description coverage). The single parameter 'email' is self-explanatory, but the description doesn't provide context about email format requirements, validation, or what happens if the email doesn't exist in the system. Baseline 3 is appropriate given the simple parameter structure.

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 ('unsubscribe or suppress') and resource ('contact in mailmodo'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'removeContactFromList' or 'archiveContact', which might have overlapping functionality.

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 like 'removeContactFromList' or 'resubscribeContact'. There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone.

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

Related 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/mailmodo/mailmodo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server