Skip to main content
Glama

Points in Territory

points_in_territory
Read-onlyIdempotent

Lists which account points from one point layer fall inside a territory polygon or a drive-time (isochrone) area: per territory, the point ids, full properties, point_count, and metric sums (metrics, else the layer's declared metric fields). Synchronous and read-only. Needs map_session_id or ts_handle. territory_id names one leaf (a stable territory_id or its exact unique display name); territory_ids names several; both omitted means every leaf in the TAL (tal_id, else the active or sole TAL). point_layer omitted uses the sole layer with points; point_filter (e.g. {tier: 'Gold'}) filters points by attribute before counting and listing. A point counts in every containing polygon, and overlaps lists points in more than one. max_points caps the points listed per territory (default 1000, max 10000); counts and sums always cover every inside point. Unknown ids return UNKNOWN_TAL_ID / UNKNOWN_TERRITORY_ID / UNKNOWN_POINT_LAYER with the available values. Territory statistics without the point list come from analyze.

Input Schema

NameRequiredDescriptionDefault
tal_idNo
metricsNo
ts_handleNo
max_pointsNo
point_layerNo
point_filterNo
territory_idNo
territory_idsNo
map_session_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / point_filter
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Point Filter"
      +}
  2. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/non-destructive, and the description confirms this but goes well beyond: max_points capping semantics ('counts and sums always cover every inside point'), the multi-polygon counting rule, the overlaps field, default/max values, and precise error codes with returned available values. That is rich behavioral context an agent cannot get from 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?

Purpose and scope are front-loaded in the first sentence, and nearly every clause carries operational detail (overlap rule, error codes, caps). It is dense and reads as one long run-on paragraph without visual grouping, which slightly hurts scannability, but no sentence is 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?

An output schema exists, so return values need not be re-explained, and the description still covers errors, defaults, counting semantics, and selection fallbacks. An agent has everything needed to call this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and it does: it explains map_session_id/ts_handle requirements, tal_id resolution fallback, territory_id (leaf, id or exact unique display name), territory_ids, point_layer defaulting, point_filter syntax with an example, metrics fallback, and max_points bounds. All nine parameters are given meaning beyond their bare titles.

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?

The description states a specific verb ('Lists') plus the exact resource ('which account points from one point layer fall inside a territory polygon or drive-time area'), and even names the return contents (point ids, properties, point_count, metric sums). An agent can distinguish it from analyze and query_parts without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly routes the alternative case ('Territory statistics without the point list come from analyze') and spells out the selection rules for each scoping parameter: territory_id vs territory_ids vs both omitted (every leaf in the TAL), and point_layer omitted (the sole layer with points). Nothing is left to inference.

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