get_daterange
Get the date range of available analytics data for a website. Provide the website UUID to retrieve the start and end dates of data coverage.
Instructions
Get the date range of available data for a website
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| websiteId | Yes | Website UUID |
Implementation Reference
- src/tools/stats.ts:142-152 (handler)The 'get_daterange' tool handler: registers the tool with the MCP server, defines the schema (websiteId only), and executes the logic by calling GET /api/websites/{websiteId}/daterange via the Umami client.
server.tool( "get_daterange", "Get the date range of available data for a website", { websiteId: z.string().describe("Website UUID"), }, async ({ websiteId }) => { const data = await client.call("GET", `/api/websites/${websiteId}/daterange`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - src/tools/stats.ts:142-152 (schema)Input schema for get_daterange: requires a single string parameter 'websiteId' (Website UUID). No output schema defined beyond returning JSON text.
server.tool( "get_daterange", "Get the date range of available data for a website", { websiteId: z.string().describe("Website UUID"), }, async ({ websiteId }) => { const data = await client.call("GET", `/api/websites/${websiteId}/daterange`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - src/tools/stats.ts:10-10 (registration)The function registerStatsTools is exported from src/tools/stats.ts and called from src/index.ts (line 30), registering all stats tools including get_daterange on the MCP server.
export function registerStatsTools(server: McpServer, client: UmamiClient) {