Skip to main content
Glama

Territory leads (grid search)

territory_leads

Find every business of a type across a radius by gridding the area past Google's result cap, deduplicating by place ID, and returning lowest-rated leads with coverage summaries.

Instructions

Every business of a kind in an area: the area is split into a grid so results go past Google's ~120-per-search cap, deduplicated by place id; only places inside the radius are kept and charged. max_places counts those, so it caps cost. Returns a summary (categories, ratings, contact coverage), the lowest-rated leads and join-key coverage. Then enrich_leads adds each lead's competitors. Takes 5-15 min for ~25 cells.

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

Input Schema

NameRequiredDescriptionDefault
queryYese.g. 'dentist'
wait_sNoSeconds to wait for the runs before returning a job id (default 45).
cell_kmNoGrid cell size (default 2; 0.5-1 in dense downtowns, 3-5 in suburbs)
languageNo
locationYesCity or 'lat,lng' at the centre of the area
max_cellsNoCap on grid cells (default 25)
radius_kmNoSearch radius (default 10)
max_placesNoCap on places (default 500)
max_cost_usdNoRefuse to start if the estimated cost is above this (USD). Default 5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the annotations (which only say non-read-only, open-world, non-idempotent), the description discloses the billing model ('only places inside the radius are kept and charged', max_places caps cost), the deduplication rule, the runtime, and the shape of the result. It also explains that the call can return a job id rather than finished data, which is important for an agent sequencing calls.

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?

It is dense and front-loaded, opening with what the tool returns before cost and timing details. The semicolon-chained run-on and trailing 'Takes 5-15 min' sentence slightly hurt scanability, but no sentence 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 9-parameter, no-output-schema tool, the description covers return contents (summary of categories, ratings, contact coverage, lowest-rated leads, join-key coverage), cost, and latency. The one gap is that it never names the polling path (job_status) for the job id hinted at by wait_s.

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 89%, so the baseline is 3, but the description adds genuine meaning: max_places is scoped to in-radius, charged places and therefore acts as the cost cap, and cell size is tied to the grid mechanism described alongside cell_km. It does not clarify language or the interaction between max_cells, radius_km and estimated cost.

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-equivalent ('every business of a kind in an area') plus the distinctive mechanism: an area split into a grid to exceed Google's ~120-per-search cap, deduplicated by place id. That is far more than a restatement of the name. It stops short of a 5 because it never explicitly contrasts the tool with the sibling 'find_places', so the agent must infer the difference between a territory sweep and a single search.

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 supplies real decision context: grid splitting is needed to go past the per-search cap, only in-radius places are charged, and it takes 5-15 min for ~25 cells, plus a follow-up step ('Then enrich_leads adds each lead's competitors'). What is missing is an explicit exclusion, e.g. when to use find_places instead of a full grid sweep.

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