Skip to main content
Glama

Zonal Statistics

zonal_statistics

Compute per-polygon statistics from a raster layer, including count, sum, mean, median, and more. Add new columns to the polygon layer with a customizable prefix.

Instructions

Per-polygon stats from a raster (native:zonalstatisticsfb). stats int codes: 0=count 1=sum 2=mean 3=median 4=stdev 5=min 6=max 7=range 8=minority 9=majority 10=variety 11=variance (default [0,1,2]). New columns prefixed by 'prefix'. No output_path = in-memory layer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bandNo
statsNo
prefixNo_
output_pathNo
raster_layerYes
polygon_layerYes
Behavior3/5

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

No annotations exist, so the description must disclose behavioral traits. It mentions that new columns are added (mutation) and that no output_path creates an in-memory layer, but does not fully clarify if the polygon layer is modified in place or if a new layer is created. Side effects are somewhat unclear.

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?

The description is dense and efficient, fitting key information in one sentence with a list. It avoids fluff, but the stat code list could be better formatted (e.g., as a bullet list).

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

Completeness2/5

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

With no annotations or output schema, and 6 parameters, the description is incomplete. It lacks explanation of the 'band' parameter and the required layers, and does not describe return values or side effects adequately for a tool of this complexity.

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 coverage is 0%, so the description should compensate. It explains stats codes, prefix, and output_path behavior, but does not mention 'band' or the required layers (polygon_layer, raster_layer). Hence, only partial coverage.

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 clearly states it computes per-polygon statistics from a raster, names the specific algorithm (native:zonalstatisticsfb), and lists stat codes. This distinguishes it from siblings like sample_raster_values or raster_calculator.

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 covers stat codes and default behavior (e.g., in-memory layer when no output_path), but does not explicitly state when to use this tool vs. alternatives or mention prerequisites. Usage context is implicit.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lefcgis/qgis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server