Skip to main content
Glama

agentanalytics.sh: Analytics Your Agent Can Use

Query

query
Read-only

Use query when other tools cannot answer. Returns grouped metric rows. property is the event property key and is required when any of those metrics is requested. Numeric metrics are Pro, with the same gating as this query, and a free account gets 403 PRO_REQUIRED. Hosted vitals are properties on page_view when the snippet has data-track-vitals="true". Use web_vitals for the p75 headline. Missing property is 400 MISSING_FIELDS. A bad key is 400 INVALID_PROPERTY_KEY. Percentiles use nearest_rank. group_by allows at most one properties. matching ^[A-Za-z0-9_]{1,128}$; another is 400 INVALID_GROUP_BY. email uses a project-scoped HMAC.

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": {
      "project": "<project>"
    },
    "name": "query"
  }
}

Input Schema

NameRequiredDescriptionDefault
emailNoCustomer email, matched by HMAC and not stored.
limitNoMax results (default 100, max 1000)
orderNoSort directiondesc
date_toNoEnd date (ISO 8601). Defaults to today.
filtersNoFilters to apply
metricsNoMetrics. sum, avg, and percentiles need property.
projectYesProject name
group_byNoGroup fields. At most one properties.<key>.
order_byNoField to sort by. Aggregate metrics such as p75 are allowed when requested
propertyNoProperty key to aggregate. Required for sum, avg, p50, p75, or p95.
date_fromNoStart date, ISO or Nd such as 30d.
count_modeNoevent_count mode. Default session_then_user.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses Pro gating on numeric metrics, the exact failure response (403 PRO_REQUIRED), the 400 codes for missing property, bad key, and invalid group_by, that percentiles use nearest_rank, and that email matching uses a project-scoped HMAC. That is unusually rich behavioral context for a read-only tool that annotations already mark as safe.

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 dense but every sentence carries operational information, front-loading the usage rule before the behavioral and error details. It is telegraphic and the error-code sentences interrupt the parameter guidance, costing a little structure, but nothing is filler.

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?

For a 12-parameter aggregation tool with no output schema, the definition covers usage, gating, error modes, and the key parameter constraints well. The main residual gap is that "grouped metric rows" never describes the actual result shape or how limit/order_by shape the response.

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 coverage is 100%, so a 3 is the floor, and the description goes beyond it: property is required when sum/avg/percentile metrics are requested, group_by allows at most one properties.<key> with the regex constraint restated, and hosted vitals live on page_view when data-track-vitals is set. It does not explain count_mode or order_by beyond the schema, so it is not a full 5.

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 gives a concrete verb and output ("Returns grouped metric rows") and positions itself as the general fallback query tool ("Use query when other tools cannot answer"), which distinguishes it from the more specialized siblings. It stops short of naming what dimensions the rows are grouped by or what the raw result shape is, so purpose is clear but not fully specified.

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

Usage Guidelines4/5

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

It states a clear selection rule — use this only when other tools cannot answer — and routes one concrete case elsewhere: "Use web_vitals for the p75 headline." That is genuine when-to-use and alternative guidance, though there are no explicit exclusions against other query-adjacent siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources