Skip to main content
Glama

archiveContact

Permanently archive contacts in Mailmodo by submitting their email address, ensuring streamlined contact management and data organization.

Instructions

permanently archive contact in mailmodo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYes

Implementation Reference

  • src/server.ts:307-337 (registration)
    Registration of the 'archiveContact' MCP tool, including inline input schema (email: z.string()) and handler function that invokes the deleteContact helper and returns a text response.
    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
          };
        }
      }
    );
  • Handler function for the 'archiveContact' tool, which calls the deleteContact API helper and formats 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
        };
      }
    }
  • Input schema for the 'archiveContact' tool using Zod (requires email string).
    {
        email: z.string()
    },
  • The deleteContact helper function that makes the actual DELETE API call to Mailmodo's /contacts endpoint to archive the contact.
    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');
        }
    }
Behavior2/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 states 'permanently archive', which implies a destructive, irreversible action, but doesn't clarify permissions required, side effects (e.g., impact on related data), or error handling. This leaves significant gaps for a mutation tool.

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 that gets straight to the point without unnecessary words. However, it could be slightly improved by front-loading key details more explicitly, but overall it's well-structured and avoids waste.

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 tool's complexity as a destructive operation with no annotations, no output schema, and low parameter documentation, the description is incomplete. It doesn't cover behavioral aspects like reversibility or permissions, nor does it hint at return values or error cases, leaving the agent with insufficient context.

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 input schema has 0% description coverage, documenting only that 'email' is a required string parameter. The description adds no meaning beyond this—it doesn't explain what the email parameter represents (e.g., the contact's email address to archive) or any format constraints, failing to compensate for the low schema coverage.

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') and the resource ('contact in mailmodo'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'removeContactFromList' or 'unsubscribeContact', which prevents a perfect score, but the verb 'archive' suggests a distinct operation.

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 'unsubscribeContact'. It lacks context about prerequisites, such as whether the contact must exist or be in a specific state, and doesn't mention any exclusions or recommended scenarios.

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