Skip to main content
Glama
Defilan

Plausible Analytics MCP Server

by Defilan

get-timeseries

Retrieve website traffic trends over time for analysis and visualization. Fetch metrics like visitors, pageviews, and bounce rates broken down by day, week, or month intervals.

Instructions

Get traffic trends over time. Returns data points broken down by time interval (day, week, or month). Use this for trend analysis and charts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_idYesDomain of the site (e.g. 'example.com')
metricsNoMetrics to retrieve
date_rangeNoTime period. Use a preset like '30d' or a custom range ['2024-01-01', '2024-01-31']30d
intervalNoTime granularity for the seriesdate
filtersNoFilters array using Plausible v2 syntax, e.g. [['is', 'event:page', ['/blog*']]]

Implementation Reference

  • The handler for the 'get-timeseries' MCP tool is defined inline within src/index.ts. It processes the arguments, queries the Plausible client, and formats the results.
    server.tool(
      "get-timeseries",
      "Get traffic trends over time. Returns data points broken down by time interval (day, week, or month). Use this for trend analysis and charts.",
      {
        site_id: z.string().describe("Domain of the site (e.g. 'example.com')"),
        metrics: metricsSchema,
        date_range: dateRangeSchema,
        interval: z
          .enum(["date", "week", "month"])
          .describe("Time granularity for the series")
          .default("date"),
        filters: filtersSchema,
      },
      async ({ site_id, metrics, date_range, interval, filters }) => {
        const dimensionKey =
          interval === "date"
            ? "time:day"
            : interval === "week"
              ? "time:week"
              : "time:month";
    
        const result = await client.query({
          site_id,
          metrics,
          date_range,
          dimensions: [dimensionKey],
          filters: filters ?? undefined,
        });
    
        // Format as an array of { date, ...metrics }
        const rows = result.results.map((r) => {
          const row: Record<string, unknown> = { date: r.dimensions[0] };
          metrics.forEach((m, i) => {
            row[m] = r.metrics[i];
          });
          return row;
        });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool returns time-series data for trend analysis, but doesn't disclose important behavioral aspects like whether this is a read-only operation, rate limits, authentication requirements, error conditions, or pagination behavior. For a data retrieval tool with 5 parameters, this leaves significant gaps in understanding how the tool behaves.

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

Conciseness5/5

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

The description is perfectly concise with two sentences that each earn their place. The first sentence states the core functionality, and the second provides usage guidance. There's zero waste or redundancy, and the information is front-loaded with the primary purpose.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what the return data looks like (structure, format), doesn't mention error conditions or limitations, and provides minimal behavioral context. The 100% schema coverage helps with parameters, but the overall context for proper tool invocation remains incomplete.

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 description coverage is 100%, so the schema already documents all 5 parameters thoroughly with descriptions, enums, defaults, and examples. The description adds minimal value beyond what's in the schema - it mentions 'time interval (day, week, or month)' which aligns with the 'interval' parameter, but doesn't provide additional semantic context about parameter interactions or usage patterns.

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 the tool's purpose: 'Get traffic trends over time' with 'Returns data points broken down by time interval'. It specifies the resource (traffic trends) and verb (get), but doesn't explicitly differentiate from sibling tools like 'get-aggregate-stats' or 'get-breakdown', which likely serve similar analytics purposes.

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

Usage Guidelines3/5

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

The description provides implied usage guidance: 'Use this for trend analysis and charts'. However, it doesn't explicitly state when to use this tool versus alternatives like 'get-aggregate-stats' or 'get-breakdown', nor does it mention any prerequisites or exclusions. The guidance is helpful but incomplete for sibling tool selection.

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/Defilan/plausible-mcp'

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