Skip to main content
Glama

Search visitors

search_visitors
Read-onlyIdempotent

Visitors in the period with source, location, pageviews and payments. Filters are visitor-level (any visit in the period); visit_* arguments instead require one single visit to match both the came-from and the reached condition (e.g. visit_source google.com and visit_page /pricing), and rows then carry matchedVisitAt (pass it to get_visitor as visit_at). Requires the visitors scope.

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": "search_visitors"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoName, email, visitor ID or user ID.
osNo
toNoLast day, YYYY-MM-DD (inclusive).
fromNoFirst day, YYYY-MM-DD (inclusive). Use with to.
sortNolatest (last pageview), earliest (first pageview), pageviews, visitor (name or email), source, country, device or paid.
limitNoRows to return (1–100).
orderNoDefault: desc for latest, pageviews and paid; asc for the others.
traitNoIdentify trait key → value (comma-separated: any of them), e.g. {"role": "founder"}. Keys come from get_visitor_traits.
deviceNo
fieldsNoOptional: only these parts of the answer, as comma-separated dot paths (e.g. overview.current,series.date,series.visitors). Through a list a path applies to every item; period is always kept. An unknown top-level name fails with the list of valid ones. Leave out for the full answer.
offsetNo
periodNoPreset period, default 30d. today/yesterday/wtd/mtd follow the timezone. Ignored when from and to are set.
browserNo
channelNoFirst-visit channel, e.g. Organic Search, Direct, Social.
compareNoWhat change figures compare against: previous (default, the equal-length window right before), weekdays (the same length, starting whole weeks earlier on the same weekday, so Mondays compare with Mondays), year (same period last year), or a YYYY-MM-DD start (window keeps the period's length). Ignored for period all.
countryNoTwo-letter country code, e.g. US (comma-separated: any of them).
filtersNoUp to six visitor filters, all of which must match. op: is, is_not (exact); contains, not_contains, starts_with, ends_with (literal text, letter case ignored); regex, not_regex (case-insensitive regular expressions up to 200 characters, without lookarounds, backreferences or repeated groups like (a+)+); is_empty, is_not_empty (no values: send []; e.g. utmCampaign is_empty = visitors who never had a campaign); gt, lt and is for visits. dim urlParam also needs key, the URL parameter name (one of the site's kept parameters): {"dim":"urlParam","key":"plan","op":"is","values":["pro"]}. dim prop (event property) needs key, the property name, and optionally goal to look only at that goal's events; values match as text (numbers and true/false too), and a visitor matches with at least one such event: {"dim":"prop","key":"plan","goal":"signup","op":"is","values":["growth"]} (list_event_properties lists names and values). dim trait needs key, a person's identify trait (get_visitor_traits lists them): {"dim":"trait","key":"role","op":"is","values":["founder"]}. Other dimensions take no key or goal. A 400 filter_too_slow means the regex was too slow: simplify it.
paymentNo
referrerNoReferrer domain contains this text, e.g. google.
timezoneNoIANA time zone for day boundaries and grouping, e.g. Europe/Madrid. Default UTC.
visits_gtNoMore than this many visits in the period (a visit ends after 30 minutes without a pageview).
visits_ltNoFewer than this many visits in the period.
utm_mediumNo
utm_sourceNo
visit_goalNoSame-visit condition, reached: this goal in the same visit, e.g. signup.
visit_pageNoSame-visit condition, reached: this exact path in the same visit, e.g. /pricing. Use at most one visit_page/visit_page_contains/visit_goal.
website_idNoWebsite ID from list_websites (the data-site-id value in the tracking script).
utm_campaignNo
visit_sourceNoSame-visit condition, came from: the visit's source, e.g. google.com (comma-separated: any of them). Use at most one visit_source/visit_channel/visit_campaign/visit_referrer/visit_entry_page.
visited_pageNoVisited this exact path, e.g. /pricing (comma-separated: any of them).
visit_channelNoSame-visit condition, came from: the visit's channel, e.g. Organic Search.
completed_goalNoCompleted this goal in the period, e.g. signup.
visit_campaignNoSame-visit condition, came from: the visit's utm_campaign.
visit_referrerNoSame-visit condition, came from: the visit's referrer contains this text, e.g. google.
visit_entry_pageNoSame-visit condition, came from: the visit's first page, e.g. /blog/launch.
visit_page_containsNoSame-visit condition, reached: a path containing this text in the same visit, e.g. /docs.
visited_page_containsNoVisited a path containing this text, e.g. /docs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare this a safe, idempotent read, and the description adds information annotations cannot carry: the required visitors scope and the fact that rows carry matchedVisitAt when visit_* conditions are used, plus the instruction to pass it to get_visitor as visit_at. This is meaningful behavioral context beyond the structured fields.

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?

Three tight clauses with no filler: what comes back, how filters differ from visit_* conditions, and the auth requirement. The same-visit explanation is dense but front-loaded after the purpose statement, and nothing is repeated from the schema.

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 37-parameter, nested-filter tool with no output schema, the description covers the return fields, the visit_* row annotation, and the scope requirement, which is what an agent needs before calling. It leaves pagination and limit defaults to the schema, which documents them, so the remaining gaps are minor.

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?

With 37 parameters at 78% schema coverage, the schema does the bulk of the work, but the description adds the crucial cross-parameter semantics the schema only hints at: filters are visitor-level while visit_* pairs are same-visit conditions. That distinction governs how the large parameter set interacts and is the main source of misuse risk.

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?

Describes the resource and returned attributes ("Visitors in the period with source, location, pageviews and payments"), which is specific enough to distinguish a visitor list from an aggregate breakdown. It does not explicitly contrast with get_path_visitors or get_visitor as list-vs-detail alternatives, so it stops short of a 5.

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?

Gives real guidance on the choice between plain visitor-level filters (any visit in the period) and the visit_* arguments that require a single matching visit, with a concrete example pairing visit_source and visit_page. However it never says when to reach for this tool rather than get_visitor, get_path_visitors or get_breakdown, so the alternatives guidance is implied rather than stated.

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