Skip to main content
Glama
mikusnuz

umami-mcp

get_metrics

Retrieve aggregated website analytics data including top pages, browsers, devices, countries, and events for specified time periods.

Instructions

Get aggregated metrics for a website (e.g. top pages, browsers, countries, devices, OS, events)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
websiteIdYesWebsite UUID
startAtYesStart timestamp in milliseconds
endAtYesEnd timestamp in milliseconds
typeYesMetric type to aggregate
urlNoFilter by URL path
referrerNoFilter by referrer
limitNoMax results to return (default 500)

Implementation Reference

  • Implementation of the 'get_metrics' tool, which handles registration of the tool with the McpServer and its execution logic, querying the UmamiClient for website metrics.
    server.tool(
      "get_metrics",
      "Get aggregated metrics for a website (e.g. top pages, browsers, countries, devices, OS, events)",
      {
        websiteId: z.string().describe("Website UUID"),
        ...dateRange,
        type: z
          .enum([
            "url",
            "referrer",
            "browser",
            "os",
            "device",
            "country",
            "region",
            "city",
            "language",
            "event",
            "query",
            "title",
            "host",
            "tag",
          ])
          .describe("Metric type to aggregate"),
        url: z.string().optional().describe("Filter by URL path"),
        referrer: z.string().optional().describe("Filter by referrer"),
        limit: z.number().optional().describe("Max results to return (default 500)"),
      },
      async ({ websiteId, startAt, endAt, type, url, referrer, limit }) => {
        const data = await client.call("GET", `/api/websites/${websiteId}/metrics`, undefined, {
          startAt,
          endAt,
          type,
          url,
          referrer,
          limit,
        });
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );

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/mikusnuz/umami-mcp'

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