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 })
        )
    );

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