Skip to main content
Glama
EvandroSchechtel

WhatsApp Business MCP Server

get_analytics

Retrieve messaging analytics including sent, delivered, and read message counts for specified date ranges to monitor WhatsApp Business performance.

Instructions

Get messaging analytics (sent, delivered, read counts) for a date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYesStart date in UNIX timestamp format
end_dateYesEnd date in UNIX timestamp format
granularityNoData granularityDAY

Implementation Reference

  • The actual implementation of the getAnalytics method, which constructs the API request to the WhatsApp Business API.
    async getAnalytics(params: {
      start: string;
      end: string;
      granularity: "HALF_HOUR" | "DAY" | "MONTH";
    }) {
      return this.request(
        `/${this.config.businessAccountId}?fields=analytics.start(${params.start}).end(${params.end}).granularity(${params.granularity})`
      );
    }
  • src/index.ts:369-387 (registration)
    Registration of the 'get_analytics' MCP tool, which validates input parameters and calls the wa.getAnalytics handler.
    server.tool(
      "get_analytics",
      "Get messaging analytics (sent, delivered, read counts) for a date range.",
      {
        start_date: z.string().describe("Start date in UNIX timestamp format"),
        end_date: z.string().describe("End date in UNIX timestamp format"),
        granularity: z
          .enum(["HALF_HOUR", "DAY", "MONTH"])
          .default("DAY")
          .describe("Data granularity"),
      },
      async ({ start_date, end_date, granularity }) =>
        executeWithHooks(
          "get_analytics",
          { start_date, end_date, granularity },
          config,
          () => wa.getAnalytics({ start: start_date, end: end_date, granularity })
        )
    );
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 retrieves analytics but doesn't mention permissions needed, rate limits, pagination, error handling, or data freshness. For a read operation with no annotation coverage, this is insufficient to inform safe and effective use.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It front-loads key information ('Get messaging analytics') and includes essential details (metrics and date range) without redundancy, making it easy to parse quickly.

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 no annotations, no output schema, and a read operation with three parameters, the description is incomplete. It doesn't explain what the output looks like (e.g., format of counts), error conditions, or behavioral constraints, leaving significant gaps for agent invocation.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents parameters like 'start_date' and 'granularity' with enums. The description adds minimal value by implying date-range filtering but doesn't explain parameter interactions or semantics beyond what's in the schema, meeting the baseline for high 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 messaging analytics (sent, delivered, read counts) for a date range.' It specifies the verb ('Get'), resource ('messaging analytics'), and key metrics, making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_business_profile' or 'get_phone_numbers', which prevents a perfect score.

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 mentions a date range but doesn't specify prerequisites, exclusions, or compare it to other analytics-related tools (none listed in siblings). This leaves the agent without context for tool selection.

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/EvandroSchechtel/mcp-whatsapp'

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