Skip to main content
Glama

Funnel conversion

get_funnel
Read-onlyIdempotent

Compute a funnel: each step counts visitors who reached it after the step before. Pass steps like ["page:/pricing", "goal:signup", "goal:checkout"] ("page:blog" = any page that contains blog, "page:/docs*" = any page that starts with /docs; a bare name is a goal; "not:upgrade" = a "did not complete" step: people who did not do the goal before the next step, never the first step), or name a funnel saved in the dashboard or in analytics.yaml. With neither, all saved funnels are computed. The result names the weakest step. revenue is the payments made after people reached a step (last touch); revenue_stopped_here is the part from people whose last step it is.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_funnel"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day, inclusive (YYYY-MM-DD).
fromNoFirst day (YYYY-MM-DD, site time zone). Use with to instead of period.
nameNoName of a saved or planned funnel.
siteNoSite domain (example.com), id or public id (tb_…). Optional with a site key, or when the account has one site.
stepsNo2 to 8 steps: page:/path, page:*text*, page:/prefix*, goal:name or not:goal_name (did not complete; not the first step).
periodNoTime range. Default 30d. today, yesterday, 24h, 7d, 30d, 90d, 12m, wtd, mtd, ytd, all.
filtersNoOnly visits that match every filter. A value is "is": {"country": "US"}; a list is "is any of": {"country": ["PT", "ES"]}; an object picks the operator: {"page": {"contains": "/blog"}}, {"channel": {"is_not": ["Direct", "Email"]}}, {"page": {"not_contains": "/admin"}}. Operators: is, is_not, contains, not_contains (case-insensitive). "visitor" is "new" or "returning". "ad" is an ad campaign as "google:<campaign id>" or "meta:<campaign id>" (the visits that the Ads page counts for it). Use "(none)" for empty values; countries take ISO codes or English names.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / filters / propertyNames / enum
      Previous value: -[
      -  "channel",
      -  "referrer",
      -  "campaign",
      -  "keyword",
      -  "source",
      -  "hostname",
      -  "entry",
      -  "exit",
      -  "country",
      -  "region",
      -  "city",
      -  "browser",
      -  "os",
      -  "device",
      -  "page",
      -  "goal",
      -  "visitor",
      -  "ad"
      -]New value: +[
      +  "channel",
      +  "referrer",
      +  "campaign",
      +  "keyword",
      +  "source",
      +  "hostname",
      +  "entry",
      +  "exit",
      +  "country",
      +  "region",
      +  "city",
      +  "browser",
      +  "os",
      +  "device",
      +  "page",
      +  "goal",
      +  "visitor",
      +  "ad",
      +  "assistant"
      +]
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description does add real behavior: the 'not:' step can never be the first step, the result names the weakest step, and it defines revenue vs revenue_stopped_here (last-touch attribution). It omits error behavior when a named funnel does not exist and how conflicting name+steps inputs are resolved.

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 core definition before syntax and return-value details, and every sentence carries information. It is a single dense paragraph with stacked parentheticals, which slows scanning of the step-syntax rules but wastes no words.

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

Completeness3/5

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

For a 7-parameter, zero-required tool with a nested filters object and no output schema, the definition covers steps and result fields well but leaves gaps: the interaction between from/to and period is only in the schema, filter operators are only in the schema, and no return shape beyond named fields is sketched despite the absence of an output schema.

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 baseline is 3, but the description genuinely adds meaning the schema does not fully convey: 'page:*blog*' = contains, 'page:/docs*' = prefix, and crucially 'a bare name is a goal' — none of which is stated in the schema text. It also shows a concrete 3-step example array.

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

Purpose5/5

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

States a specific verb and resource ('Compute a funnel') plus the counting rule ('each step counts visitors who reached it after the step before'), which cleanly separates it from create_funnel/list_funnels/update_funnel siblings. An agent can pick it without opening any other schema.

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 three explicit operating modes: pass inline steps, name a saved funnel, or pass neither to compute all saved funnels. It stops short of naming sibling alternatives (e.g. list_funnels for browsing definitions), but the invocation decision logic is clear.

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