Skip to main content
Glama
mikusnuz

umami-mcp

list_reports

List all saved reports with pagination and sorting options. Use page, pageSize, and orderBy parameters to retrieve a customized list of reports for analysis.

Instructions

List all saved reports

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (1-based)
pageSizeNoResults per page
orderByNoField to order by

Implementation Reference

  • The handler for the 'list_reports' tool. It registers a tool on the MCP server that lists all saved reports by calling GET /api/reports with optional page, pageSize, and orderBy query parameters.
    server.tool(
      "list_reports",
      "List all saved reports",
      {
        page: z.number().optional().describe("Page number (1-based)"),
        pageSize: z.number().optional().describe("Results per page"),
        orderBy: z.string().optional().describe("Field to order by"),
      },
      async ({ page, pageSize, orderBy }) => {
        const data = await client.call("GET", "/api/reports", undefined, {
          page,
          pageSize,
          orderBy,
        });
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
  • The input schema for 'list_reports' defines optional parameters: page (number), pageSize (number), and orderBy (string), all validated with Zod.
    server.tool(
      "list_reports",
      "List all saved reports",
      {
        page: z.number().optional().describe("Page number (1-based)"),
        pageSize: z.number().optional().describe("Results per page"),
        orderBy: z.string().optional().describe("Field to order by"),
      },
      async ({ page, pageSize, orderBy }) => {
        const data = await client.call("GET", "/api/reports", undefined, {
          page,
          pageSize,
          orderBy,
        });
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      }
    );
  • The tool is registered via server.tool('list_reports', ...) inside the registerReportTools function, which is called from src/index.ts (line 33).
    export function registerReportTools(server: McpServer, client: UmamiClient) {
      server.tool(
        "list_reports",
        "List all saved reports",
        {
          page: z.number().optional().describe("Page number (1-based)"),
          pageSize: z.number().optional().describe("Results per page"),
          orderBy: z.string().optional().describe("Field to order by"),
        },
        async ({ page, pageSize, orderBy }) => {
          const data = await client.call("GET", "/api/reports", undefined, {
            page,
            pageSize,
            orderBy,
          });
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        }
      );
    
      server.tool(
        "get_report",
        "Get details of a specific saved report",
        {
          reportId: z.string().describe("Report UUID"),
        },
        async ({ reportId }) => {
          const data = await client.call("GET", `/api/reports/${reportId}`);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        }
      );
    
      server.tool(
        "create_report",
        "Create and save a new report",
        {
          websiteId: z.string().describe("Website UUID"),
          name: z.string().describe("Report name"),
          type: z
            .enum(["funnel", "retention", "utm", "goals", "insights", "revenue", "journey", "attribution"])
            .describe("Report type"),
          description: z.string().optional().describe("Report description"),
          parameters: z
            .record(z.unknown())
            .optional()
            .describe("Report-specific parameters (JSON object)"),
        },
        async ({ websiteId, name, type, description, parameters }) => {
          const body: Record<string, unknown> = { websiteId, name, type };
          if (description) body.description = description;
          if (parameters) body.parameters = parameters;
          const data = await client.call("POST", "/api/reports", body);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        }
      );
    
      server.tool(
        "update_report",
        "Update an existing saved report",
        {
          reportId: z.string().describe("Report UUID"),
          websiteId: z.string().optional().describe("Website UUID"),
          name: z.string().optional().describe("Report name"),
          type: z
            .enum(["funnel", "retention", "utm", "goals", "insights", "revenue", "journey", "attribution"])
            .optional()
            .describe("Report type"),
          description: z.string().optional().describe("Report description"),
          parameters: z
            .record(z.unknown())
            .optional()
            .describe("Report-specific parameters (JSON object)"),
        },
        async ({ reportId, websiteId, name, type, description, parameters }) => {
          const body: Record<string, unknown> = {};
          if (websiteId !== undefined) body.websiteId = websiteId;
          if (name !== undefined) body.name = name;
          if (type !== undefined) body.type = type;
          if (description !== undefined) body.description = description;
          if (parameters !== undefined) body.parameters = parameters;
          const data = await client.call("POST", `/api/reports/${reportId}`, body);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        }
      );
    
      server.tool(
        "delete_report",
        "Delete a saved report",
        {
          reportId: z.string().describe("Report UUID to delete"),
        },
        async ({ reportId }) => {
          await client.call("DELETE", `/api/reports/${reportId}`);
          return { content: [{ type: "text", text: `Report ${reportId} deleted successfully.` }] };
        }
      );
    
      server.tool(
        "run_report",
        "Execute a report by type and get results (funnel, retention, utm, goals, insights, revenue, journey, attribution)",
        {
          type: z
            .enum(["funnel", "retention", "utm", "goals", "insights", "revenue", "journey", "attribution"])
            .describe("Report type to run"),
          websiteId: z.string().describe("Website UUID"),
          parameters: z
            .record(z.unknown())
            .describe("Report-specific parameters (varies by type)"),
        },
        async ({ type, websiteId, parameters }) => {
          const body: Record<string, unknown> = { websiteId, ...parameters };
          const data = await client.call("POST", `/api/reports/${type}`, body);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        }
      );
    }
  • Imports used by the handler: McpServer from the MCP SDK, z from Zod for schema validation, and UmamiClient for API calls.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { z } from "zod";
    import { UmamiClient } from "../client.js";
  • src/index.ts:33-33 (registration)
    The registration call site: registerReportTools(server, client) is invoked in the main server setup, which registers the 'list_reports' tool.
    registerReportTools(server, client);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full burden to disclose behavior. It does not mention pagination, authentication needs, or data scope beyond 'all saved reports'. The optional parameters imply pagination and sorting, but these are not described in the tool description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, very concise and front-loaded. It wastes no words, though it could expand slightly on output or behavior without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description omits output format, pagination behavior, and any constraints. Since no output schema exists, the description should clarify what the list contains (e.g., report metadata). It is incomplete for a tool with three optional parameters and no return details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all 3 parameters (page, pageSize, orderBy). The tool description adds no extra parameter context, meeting the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List all saved reports', specifying the verb and resource. While it doesn't explicitly distinguish from siblings like get_website_reports, the name and verb imply a general listing of reports, which is distinct from single-report retrieval or other operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use list_reports versus alternatives like get_website_reports or run_report. The description doesn't mention context, prerequisites, or exclusions, leaving the agent without decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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