Skip to main content
Glama

MailmodoCampainReportTool

Generate detailed campaign reports, including open, click, and submission counts, by providing campaign ID and date range for accurate performance analysis.

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

  • Handler function for MailmodoCampainReportTool that fetches the campaign report using the helper and returns the JSON data or an error message as text content.
    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"
        }]
      }
    }
  • Input schema validation using Zod for campaignId (UUID string), fromDate and toDate (strings matching YYYY-MM-DD regex).
    {
      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',
      }),
    },
  • src/server.ts:78-97 (registration)
    Registration of the MailmodoCampainReportTool using McpServer.tool, including description, input schema, and inline handler function.
    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"
          }]
        }
      }
    );
  • Supporting helper function that performs the actual API call to Mailmodo to retrieve campaign report data for the given campaign ID, date range, and API key.
    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};
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' reports, implying a read-only operation, but doesn't clarify if it's safe (e.g., non-destructive), requires authentication, has rate limits, or what the output format is. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 front-loads the purpose ('Tool to get the campaign reports') and includes examples. There's no wasted text, but it could be slightly more structured (e.g., separating purpose from examples).

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 (3 required parameters, no annotations, no output schema), the description is incomplete. It doesn't explain parameter meanings, output format, or behavioral traits like safety or constraints. For a reporting tool with no structured support, more detail is needed to be fully helpful.

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 3 parameters with 0% description coverage (no schema descriptions). The description mentions 'campaign reports' and 'like open, click submission count etc,' but doesn't explain what campaignId, fromDate, or toDate mean or how they affect the report. It adds minimal semantic value beyond the schema's structure, failing to compensate for the low 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 tool's purpose: 'get the campaign reports for a particular campaign like open, click submission count etc.' It specifies the verb ('get') and resource ('campaign reports'), and mentions example metrics (open, click, submission count). However, it doesn't explicitly differentiate from sibling tools (e.g., broadcastCampaignToList, sendEmailToCampaign), which would require a 5.

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. It doesn't mention prerequisites (e.g., needing a campaignId), exclusions, or comparisons to sibling tools like broadcastCampaignToList or sendEmailToCampaign. Usage is implied from the purpose but not explicitly stated.

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