Skip to main content
Glama

aggregate

Computes group-by statistics—count, count_distinct, sum, avg, min, max, geodesic area and length—over a map layer with optional filters and grouping, returning a table without geometry.

Instructions

Group-by statistics over a layer: count, count_distinct, sum, avg, min, max, area_km2 (geodesic polygon area), length_km (geodesic line length), optionally grouped by columns and filtered. Returns a table (no geometry).

Input Schema

NameRequiredDescriptionDefault
layerYes
limitNoMax rows to return (default 100; server-side cap applies).
filtersNoAttribute filters on the layer, combined with AND.
metricsNoMeasures to compute (default: count).
group_byNoColumns to group by.
order_byNoOutput column to sort by (default: first metric).
descendingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and only partially meets it: it discloses the output shape (a table, no geometry) and that area_km2/length_km are geodesic, which is genuinely useful. It never says the operation is read-only, says nothing about the server-side row cap or default of 100 (left to the schema), and does not describe error behavior for unknown columns or invalid metric/column pairings.

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?

Two front-loaded sentences with no filler; the output-shape caveat is placed at the end where it is most useful. Slight redundancy in re-listing the full aggregation enum, which the schema already defines.

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 7-parameter tool with no output schema, the description correctly tells the agent what comes back (a table without geometry), which is the single most important missing structured fact. It leaves the row-limit and ordering behavior entirely to the schema, which is acceptable but keeps it short of complete.

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

Parameters3/5

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

Schema description coverage is 71%, so the schema does most of the work and the baseline of 3 applies. The description confirms the metrics/group-by/filter concepts but adds no meaning for limit, order_by, or descending, and does not explain the interaction between order_by and the default 'first metric'.

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 ('Group-by statistics over a layer') and enumerates the supported measures (count, count_distinct, sum, avg, min, max, area_km2, length_km). The closing note 'Returns a table (no geometry)' separates it from geometry-returning siblings like find_features, sample_features and buffer.

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?

The description implies usage (you want grouped statistics rather than rows) but never states when to prefer it over run_sql, which is the obvious alternative for arbitrary aggregation. There are no exclusions, no prerequisites, and no note about when find_features would be the better choice.

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