Skip to main content
Glama

resubscribeContact

Re-enable email communication with previously unsubscribed contacts in Mailmodo by resubscribing them using their email address.

Instructions

Resubscribe contact in mailmodo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYes

Implementation Reference

  • Full handler registration block for the 'resubscribeContact' MCP tool, including description, input schema, and the async execution function that calls the API helper and returns a textual response.
    server.tool(
      "resubscribeContact",
      "Resubscribe contact in mailmodo",
      {
          email: z.string()
      },
      async (params) => {
        try {
          const respone = await resubscribeContact(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 resubscribed '${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
          };
        }
      }
    );
  • Input validation schema using Zod for the tool parameters: requires an 'email' string.
    {
        email: z.string()
    },
  • The core helper function that performs the HTTP POST request to the Mailmodo API to resubscribe a contact by email, handles errors, and returns a standardized response.
    export async function resubscribeContact(
        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/resubscribe',
                {
                    email,
                },
                {
                    headers: {
                        'Accept': 'application/json',
                        'Content-Type': 'application/json',
                        'mmApiKey': mmApiKey || ''
                    }
                }
            );
    
            return {success: true, message: response.data.message};
        } 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');
        }
    }
  • TypeScript type definition for the API response used by resubscribeContact (and similar functions): indicates success and optional message.
    export interface AddContactToListResponse {
        // Define your expected response structure here
        success: boolean;
        message?: string;
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is a mutation (likely), requires specific permissions, has side effects (e.g., affecting mailing lists), rate limits, or response format. This is inadequate for a tool that presumably modifies contact status.

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 a single, efficient sentence with no wasted words, making it appropriately concise. However, it's front-loaded but lacks depth, as it doesn't provide necessary details for effective use, balancing brevity with under-specification.

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?

Given no annotations, 0% schema coverage, no output schema, and a single parameter, the description is incomplete. It fails to address key aspects like behavioral traits, parameter meaning, or usage context, making it insufficient for an agent to reliably invoke this mutation tool without guesswork.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain the 'email' parameter's role (e.g., identifier for the contact to resubscribe), format, or constraints, leaving semantics unclear beyond the schema's basic type.

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

Purpose3/5

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

The description states the action ('resubscribe') and resource ('contact in mailmodo'), providing a basic purpose. However, it's vague about what 'resubscribe' entails (e.g., reversing an unsubscribe, adding to mailing lists) and doesn't differentiate from siblings like 'unsubscribeContact' or 'addContactToList', leaving ambiguity in scope.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description implies usage for resubscribing contacts, but it doesn't specify prerequisites (e.g., contact must be previously unsubscribed), exclusions, or comparisons to siblings like 'addContactToList' or 'unsubscribeContact', leaving the agent to infer context.

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