Skip to main content
Glama
mikusnuz

umami-mcp

get_stats

Retrieve website analytics statistics including pageviews, visitors, visits, bounces, and total time for specified time periods and filters.

Instructions

Get summary statistics for a website (pageviews, visitors, visits, bounces, totaltime)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
websiteIdYesWebsite UUID
startAtYesStart timestamp in milliseconds
endAtYesEnd timestamp in milliseconds
urlNoFilter by URL path
referrerNoFilter by referrer

Implementation Reference

  • The handler function for the get_stats tool which calls the Umami API to fetch website statistics.
    async ({ websiteId, startAt, endAt, url, referrer }) => {
      const data = await client.call("GET", `/api/websites/${websiteId}/stats`, undefined, {
        startAt,
        endAt,
        url,
        referrer,
      });
      return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
    }
  • Registration of the get_stats tool using the MCP server instance, including parameter schema definition.
    server.tool(
      "get_stats",
      "Get summary statistics for a website (pageviews, visitors, visits, bounces, totaltime)",
      {
        websiteId: z.string().describe("Website UUID"),
        ...dateRange,
        url: z.string().optional().describe("Filter by URL path"),
        referrer: z.string().optional().describe("Filter by referrer"),
      },
      async ({ websiteId, startAt, endAt, url, referrer }) => {
        const data = await client.call("GET", `/api/websites/${websiteId}/stats`, undefined, {
          startAt,
          endAt,
          url,
          referrer,
        });
        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