Skip to main content
Glama
mikusnuz

umami-mcp

get_pageviews

Retrieve pageview and session analytics for websites over specified time periods. Filter data by URL, referrer, timezone, and grouping units to analyze traffic patterns.

Instructions

Get pageview and session counts over time for a website

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
websiteIdYesWebsite UUID
startAtYesStart timestamp in milliseconds
endAtYesEnd timestamp in milliseconds
unitYesTime grouping unit
timezoneNoTimezone (e.g. 'Asia/Seoul')
urlNoFilter by URL path
referrerNoFilter by referrer

Implementation Reference

  • The 'get_pageviews' tool is registered and implemented in src/tools/stats.ts using the server.tool method. It takes various parameters to fetch pageview and session counts from the Umami API.
    server.tool(
      "get_pageviews",
      "Get pageview and session counts over time for a website",
      {
        websiteId: z.string().describe("Website UUID"),
        ...dateRange,
        unit: z.enum(["hour", "day", "week", "month", "year"]).describe("Time grouping unit"),
        timezone: z.string().optional().describe("Timezone (e.g. 'Asia/Seoul')"),
        url: z.string().optional().describe("Filter by URL path"),
        referrer: z.string().optional().describe("Filter by referrer"),
      },
      async ({ websiteId, startAt, endAt, unit, timezone, url, referrer }) => {
        const data = await client.call("GET", `/api/websites/${websiteId}/pageviews`, undefined, {
          startAt,
          endAt,
          unit,
          timezone,
          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