Skip to main content
Glama

Get Site Analytics

get_analytics
Read-only

Use this when the user asks about traffic, visitors, or which pages/referrers are performing on their PUBLISHED site. Backed by the same analytics as the Kleap dashboard's Visitors view. Returns zeroed data with configured:false if the app has never been published (analytics is set up automatically on publish). Requires the analytics:read scope — sessions connected BEFORE this tool shipped don't have it: on INSUFFICIENT_SCOPE the connection has NOT expired: it was authorized before this tool existed and needs one re-authorization to add the scope. Say that, never that it expired.

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": {
      "app_id": "<app_id>",
      "context": "<context>"
    },
    "name": "get_analytics"
  }
}

Input Schema

NameRequiredDescriptionDefault
app_idYesThe app id to fetch analytics for
periodNoTime window: '7d' (default), '30d', or '90d'
contextYesWhy this call, in one short sentence. Used to improve the connector; never include credentials or personal data.

Output Schema

NameRequiredDescriptionDefault
app_idNo
periodNo
visitorsNo
pageviewsNo
referrersNo
top_pagesNo
configuredNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Goes well past the readOnly/openWorld annotations: it discloses the zeroed-data + configured:false contract for unpublished apps, explains that analytics is provisioned automatically on publish, and states the required analytics:read scope. Most valuable is the explicit INSUFFICIENT_SCOPE handling instruction — the connection did not expire, it predates the tool and needs one re-authorization — which prevents a specific, likely agent error.

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-loaded with the trigger condition, then prerequisite/result semantics, then error handling — a logical progression where nearly every sentence carries operational value. The scope-error paragraph is dense and relies on capitalized emphasis, which is slightly heavier than needed, but it is not filler.

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

Completeness5/5

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

For a read-only analytics tool with annotations, an output schema, and full parameter documentation, the description covers the remaining agent-critical unknowns: the scope prerequisite, the unpublished-app result contract, and the correct interpretation of INSUFFICIENT_SCOPE. Nothing an agent needs in order to call this correctly and report results honestly is missing.

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 app_id, period, and context are already documented in the schema, and the description adds no syntax or format detail for any of them. It does implicitly describe the semantics of the period window through its usage framing, but no meaningful parameter-level value is added beyond the structured fields. Baseline 3 is appropriate when the schema carries the load.

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 names a specific resource and the exact question class it answers: 'traffic, visitors, or which pages/referrers are performing on their PUBLISHED site.' The 'PUBLISHED site' qualifier and the 'Kleap dashboard's Visitors view' mapping sharpen scope considerably. It does not name get_search_console as the adjacent alternative, so sibling differentiation is implied by scope rather than stated.

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?

Explicit when-to-use trigger: 'Use this when the user asks about traffic, visitors, or which pages/referrers are performing.' It also implies a when-not by scoping to published sites only ('Returns zeroed data with configured:false if the app has never been published'), which tells the agent how to interpret an empty result rather than routing elsewhere. No alternatives are named and no exclusions for unpublished apps are stated as a hard precondition.

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