Skip to main content
Glama

MailmodoCampainReportTool

Get campaign reports with open, click, and submission counts for a specified campaign ID within a date range.

Instructions

Tool to get the campaign reports for a particular campaign like open, click submission count etc

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaignIdYes
fromDateYes
toDateYes

Implementation Reference

  • src/server.ts:78-97 (registration)
    Registration of the 'MailmodoCampainReportTool' tool on the MCP server with input schema (campaignId, fromDate, toDate) and handler invocation.
    server.tool("MailmodoCampainReportTool", "Tool to get the campaign reports for a particular campaign like open, click submission count etc",
      {
        campaignId: z.string().uuid(),
        fromDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, {
          message: 'fromDate must be in YYYY-MM-DD format',
        }),
        toDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, {
          message: 'toDate must be in YYYY-MM-DD format',
        }),
      },
      async ({ campaignId, fromDate, toDate  }) => {
        const campaigns = await fetchCampaignReport(mmApiKey,campaignId,fromDate,toDate);
        return {
          content: [{
            type: "text",
            text: campaigns.success? JSON.stringify(campaigns.data): "Something went wrong. Please check if correct campaign ID is being passed"
          }]
        }
      }
    );
  • The fetchCampaignReport async function that executes the tool logic: makes a POST request to Mailmodo API to get campaign reports.
    export async function fetchCampaignReport(
      mmApiKey: string,
      campaignId: string,
      fromDate: string, toDate: string
    ): Promise<CampaignReportResponse> {
      try {
        const response = await axios.post(
          `https://api.mailmodo.com/api/v1/campaignReports/${campaignId}`,
          {
            fromDate,
            toDate
          },
          {
            headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json',
              'mmApiKey': mmApiKey || ''
            }
          }
        );
        return {success: true, data: response.data};
      } catch (error) {
        console.error('Error fetching campaign report:', error);
        return {success: false, data: null};
      }
    }
  • Type definitions for the campaign report response including CampaignReportData interface with all analytics/engagement metrics and CampaignReportResponse wrapper.
    export type CampaignType = 'TRIGGERED' | 'SCHEDULED' | 'DRAFT'; // Add other possible values if needed
    export type CampaignStatus = 'Triggered' | 'Scheduled' | 'Draft' | 'Completed'; // Add other possible values if needed
    
    export interface CampaignReportData {
      campaignId: string;
      campaignType: CampaignType;
      campaignName: string;
      status: CampaignStatus;
      senderEmail: string;
      subjects: string[];
      createdAt: string;
      scheduledAt: string;
      
      // Analytics metrics
      bounced: number;
      complaints: number;
      submission: number;
      unsubscribed: number;
      blocked: number;
      scheduled: number;
      sent: number;
      delivered: number;
      
      // Engagement metrics
      clicks: number;
      ampClicks: number;
      htmlClicks: number;
      ampOpens: number;
      htmlOpens: number;
      opens: number;
    }
    
    export interface CampaignReportResponse{
        success: boolean,
        data: CampaignReportData | null;
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It only states 'get' implying read-only, but does not specify authentication needs, rate limits, or whether the operation is destructive. The description is insufficient for behavioral transparency.

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 would benefit from being broken into separate statements for clarity.

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 has three required parameters and no output schema, the description is incomplete. It does not explain what the tool returns, how the date range is applied, or any constraints. Missing essential context.

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

Parameters1/5

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

Input schema has no descriptions for parameters and schema coverage is 0%. The description does not explain campaignId, fromDate, or toDate, despite mentioning campaign reports. It adds no meaning beyond the schema.

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 tool retrieves campaign reports for a specific campaign, giving examples like open, click, submission count. This distinguishes it from sibling tools that send emails or manage contacts. However, it could be more precise about the exact metrics included.

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 versus alternatives, such as when to use broadcastCampaignToList or userDetails. The description lacks explicit context for 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