Skip to main content
Glama

run_query

Read-only

Execute structured analytics queries for metrics like pageviews, visitors, sessions, and events. Use filters, breakdowns, or timeseries to get product analytics without writing SQL or using AI.

Instructions

Execute a typed analytics plan without AI or SQL. Fields: metric (pageviews|visitors|sessions|events|event_count), mode (total|timeseries|breakdown), event_name (required for event_count), dimension (for breakdown), interval (day|hour), date_from/date_to (ISO UTC), limit (1..100), filters ([{field, values}]). Filter fields: path, utm_source, utm_medium, utm_campaign, device, browser, os, country, event. Filters are ANDed; values within each filter are ORed. Returns resolved plan and caveats. Example: {"metric":"event_count","event_name":"signup","mode":"breakdown","dimension":"device"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
planYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare the safe read-only profile, yet the description adds real behavioral context: the AND-across-filters / OR-within-values semantics and the fact that it returns a resolved plan plus caveats. It omits auth/rate-limit context, but the added filter semantics are valuable beyond the annotations.

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?

Front-loads the one-line purpose, then proceeds through fields, filter semantics, and an example in dense, ordered form. It runs long but nearly every clause carries invocation-relevant information, so little is wasted.

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

Completeness4/5

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

Covers conditional field requirements, formats, filter combination logic, and return contents, and with an output schema present it needn't detail the response. A concrete example seals invocation understanding; only explicit sibling routing is missing.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must carry the burden, and it does: conditional requirements (event_name required for event_count, dimension for breakdown), date format (ISO UTC), limit range, full filter field list, and a worked example. The enum value lists partly restate the schema, but the conditional logic and format details are net-new meaning.

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?

States a precise verb+resource ('Execute a typed analytics plan') and differentiates by channel ('without AI or SQL'), which distinguishes it from an ask-style sibling. It does not, however, name the specific siblings it competes with (query_metrics, breakdown, compare).

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 phrase 'without AI or SQL' implies this is the deterministic path versus AI-driven tools, giving implicit usage guidance. But there is no explicit when-to-use/when-not framing and no named alternatives among the many analytical siblings (breakdown, funnel_report, compare).

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