Skip to main content
Glama
mcp-piwik

mcp-piwik

piwik_custom_query

Run custom Piwik PRO analytics queries by choosing dimensions, metrics, dates, and limits to retrieve tailored site performance data.

Instructions

Run a custom analytics query with specified dimensions and metrics

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "siteId": "<siteId>",
      "columns": "<columns>"
    },
    "name": "piwik_custom_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of results (default 50)
dateToNoEnd date (YYYY-MM-DD). Defaults to today
siteIdYesThe site/app ID
columnsYesColumn IDs to query (e.g., ['sessions', 'page_views', 'country'])
dateFromNoStart date (YYYY-MM-DD). Defaults to 30 days ago

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden, yet it says nothing beyond the name. It does not confirm this is a read-only query, does not explain result caps or default limits, and gives no hint about error behavior for invalid column IDs or date ranges.

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?

A single short sentence that is front-loaded with the core action. Nothing is padded, though the brevity comes at the cost of the missing guidance noted elsewhere.

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?

This is a flexible query tool with five parameters, no output schema, and no annotations, so the description needed to explain what comes back and how to build a valid query. Instead it offers one sentence, leaving return shape, column validity, and read-only semantics unexplained.

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 every parameter including siteId, columns, dateFrom, dateTo, and limit is documented in the schema itself. The description adds no meaning beyond that, so the baseline of 3 applies.

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

Purpose3/5

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

The description gives a verb and resource ("Run a custom analytics query") and mentions dimensions and metrics, so the general intent is inferable. However, it does not distinguish this tool from siblings such as piwik_analytics_summary or piwik_top_pages, and its vocabulary ("dimensions and metrics") does not match the schema's "columns", leaving the agent to reconcile the two.

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?

There is no statement of when to use this tool versus the predefined report tools, and no mention that piwik_available_columns should be consulted to discover valid column IDs. The agent is left to guess whether a custom query is warranted or which column names are legal.

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