Skip to main content
Glama

Define events without touching the site

analytics_define_events
Idempotent

The events to count from what the script already sees, replacing the site's defined events: a click (on an element by its words, or by its path from analytics_heatmap), a page reached, a page scrolled past a share, time spent on a page, or an event the site sends narrowed by its props (a link out to calendly.com is {"event": "Outbound link", "props": {"url": "https://calendly.com/*"}}). Nobody edits the site. Page, scroll, time and event rules count backwards over the stored months too; clicks count from now on. A defined event works wherever an event does: analytics_stats, goals, funnels, filters and analytics_breakdown. An empty list removes them. Free.

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": {
      "site": "<site>",
      "events": "<events>"
    },
    "name": "analytics_define_events"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteYesThe site's domain (e.g. halversoncycle.example) or its site_id.
eventsYes

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?

Adds substantial behavior beyond the annotations: it REPLACES existing definitions rather than adding, page/scroll/time/event rules backfill over stored months while clicks are forward-only, and an empty list removes everything. These are exactly the non-obvious consequences an agent needs, plus a free-cost note.

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?

Dense but front-loaded, with the replace semantics and rule kinds leading. It is essentially one sprawling sentence with heavy parentheticals, so some structural efficiency is lost, but almost every clause carries useful information.

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 config-mutating tool with annotations and no output schema, it covers replace semantics, retroactivity, downstream usability, deletion via empty list, and cost. Missing only auth/permission prerequisites, which is a minor gap given the rest.

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 50% at the top level, but the nested event fields are well documented in the schema; the description adds meaning with a concrete narrowing example ('{"event": "Outbound link", "props": {"url": "https://calendly.com/*"}}') and clarifies click matching by words vs by heatmap path.

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 specific verb and resource ('the events to count', 'replacing the site's defined events') and enumerates the five rule kinds (click, page, scroll, time, event). The 'replacing' semantics implicitly separates it from the additive-looking sibling analytics_add_events, though that sibling is never named.

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?

Gives concrete contexts (works wherever an event does in analytics_stats, goals, funnels, filters, analytics_breakdown) and explains that no site edit is needed. It does not explicitly say when to choose it over analytics_add_events, leaving that inference to the reader.

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