Skip to main content
Glama

resubscribeContact

Re-add a previously unsubscribed contact to your Mailmodo mailing list by providing their email address. Restore communication with opted-out subscribers.

Instructions

Resubscribe contact in mailmodo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYes

Implementation Reference

  • The actual implementation of the resubscribeContact function. It takes mmApiKey and email, validates email is provided, then makes an axios POST to 'https://api.mailmodo.com/api/v1/contacts/resubscribe' with the email and API key in headers. Returns an AddContactToListResponse with success/message.
    /**
     * Resubscribes a contact using their email address
     * @param email - Email address of the contact to unsubscribe
     * @returns Promise with the API response
     * @throws Error if email is not provided or if an unexpected error occurs
     */
    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');
        }
    }
  • src/server.ts:275-305 (registration)
    Registration of the 'resubscribeContact' tool on the MCP server. Defines input schema (email: z.string()), description 'Resubscribe contact in mailmodo', and the async handler that calls resubscribeContact(mmApiKey, params.email) and returns the 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
          };
        }
      }
    );
  • The AddContactToListResponse interface used as the return type of resubscribeContact. Contains success (boolean) and optional message (string).
    export interface AddContactToListResponse {
        // Define your expected response structure here
        success: boolean;
        message?: string;
    }
  • Import statement for resubscribeContact from the contactManagement module into server.ts.
    import { addContactToList, bulkAddContactToList, deleteContact, getAllContactLists, getContactDetails, removeContactFromList, resubscribeContact, unsubscribeContact } from "./apicalls/contactManagement";
Behavior2/5

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

No annotations are present, and the description merely states the action without explaining behavioral traits—such as whether it overwrites subscription status or requires a prior unsubscribed state. This is insufficient for an agent to understand side effects.

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

Conciseness3/5

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

The description is extremely short (two words plus context), which is concise but lacks structure. It could be more informative without sacrificing brevity.

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 the simple input schema and no output schema, the description should explain the action's effect, prerequisites, and possible return values. It only states 'Resubscribe contact in mailmodo', leaving many gaps.

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?

The schema defines one parameter 'email' (required, string) with 0% documentation coverage in the schema description. The tool description adds no extra meaning—no format, example, or constraint beyond the schema field name.

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 states 'Resubscribe contact in mailmodo', clearly indicating the action (resubscribe) and the resource (contact). However, it does not differentiate from sibling tools like 'unsubscribeContact' or 'addContactToList'.

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 guidance is provided on when to use resubscribeContact versus alternatives such as unsubscribeContact or addBulkContactToList. The description lacks context for appropriate usage.

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

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