Skip to main content
Glama

archiveContact

Permanently archive a contact in Mailmodo by providing their email address. The contact is removed from active lists and will not receive future communications.

Instructions

permanently archive contact in mailmodo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYes

Implementation Reference

  • src/server.ts:307-337 (registration)
    Registration of the 'archiveContact' tool via server.tool() with an email string schema and handler that calls deleteContact.
    server.tool(
      "archiveContact",
      "permanently archive contact in mailmodo",
      {
          email: z.string()
      },
      async (params) => {
        try {
          const respone = await deleteContact(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 deleted '${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 delete",
            }],
            isError: true
          };
        }
      }
    );
  • The async handler function for archiveContact: calls deleteContact(mmApiKey, email) and returns the response.
    async (params) => {
      try {
        const respone = await deleteContact(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 deleted '${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 delete",
          }],
          isError: true
        };
      }
    }
  • Zod schema for archiveContact input: requires a string 'email' field.
    {
        email: z.string()
    },
  • The deleteContact helper function that makes the actual API call to mailmodo to delete/archive a contact by email.
    export async function deleteContact(
        mmApiKey: string,
        email: string
    ): Promise<AddContactToListResponse> {
        if (!email) {
            throw new Error('Email is a required field');
        }
    
        try {
            const response = await axios.delete<AddContactToListResponse>(
                'https://api.mailmodo.com/api/v1/contacts',
                {
                    headers: {
                        'Accept': 'application/json',
                        'mmApiKey': mmApiKey || ''
                    },
                    data: {
                        email
                    }
                }
            );
            return response.data;
        } catch (error) {
            if (error instanceof AxiosError) {
                if(error.status === 400){
                    return {
                        success: true,
                        message: "User Doesn't exist in system or already archived"
                    };
                }
                return {
                    success: false,
                    message: error.response?.data?.message || 'Failed to delete contact'
                };
            }
            throw new Error('An unexpected error occurred');
        }
  • The AddContactToListResponse interface used as the return type of deleteContact.
    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?

No annotations provided, so the description must disclose behavior. It states 'permanently archive' but does not clarify whether the action is reversible, what effects it has on the contact's data, or if it triggers any 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 a single sentence, which is concise but lacks structure. It is minimally acceptable for a one-parameter tool, but not well-fomatted.

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 simplicity (one parameter, no output schema), the description should explain the semantics of 'archive' (e.g., whether it deletes, suppresses, or hides the contact). The presence of sibling tools makes this gap more significant.

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 only parameter 'email' has no additional meaning beyond the schema type (string). The description does not provide format expectations, examples, or constraints, leaving the agent to guess.

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 (permanently archive contact) and the resource (contact in mailmodo). It distinguishes from siblings like removeContactFromList and unsubscribeContact, though the term 'permanently' could imply deletion, which may cause confusion.

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 on when to use this tool over alternatives such as removeContactFromList or unsubscribeContact. The description does not specify context or conditions for archiving.

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