Skip to main content
Glama
IBM
by IBM

stac_zonal_stats

Read raster values within zones (points or polygons) to compute per-zone statistics like mean, median, min, max, and detect local anomalies using a z-score comparison with surrounding background.

Instructions

Read out a raster's values within zones — the inference step after a fetch.

Given a stored raster artifact (e.g. an NDVI index from stac_compute_index, or any GeoTIFF from stac_download_bands) and target zones, return per-zone statistics (n_valid, mean, std, min, max, median, p10, p90).

Zones are either circular buffers around points, or GeoJSON polygons:

  • points: [[x, y], ...] centres in zones_crs, each summarised within buffer_m.

  • geojson: a geometry / Feature / FeatureCollection (polygons) in zones_crs.

Pass background_m (> buffer_m) to also get a LOCAL ANOMALY readout: each point's mean is compared to the surrounding annulus (buffer_m..background_m) and reported as a z-score, with anomalous set when |z| >= z_threshold. This is the direct "is the signal at this location anomalous vs its surroundings?" answer — e.g. a cropmark/soil-mark over a buried feature in an NDVI raster.

Args: artifact_id: A GeoTIFF raster artifact (NOT a PNG preview). points: Zone centres [[x, y], ...] in zones_crs (e.g. BNG eastings/northings). buffer_m: Circular zone radius in metres (raster must be projected). background_m: Outer annulus radius in metres → enables the z-score readout. geojson: Alternative polygon zones (geometry/Feature/FeatureCollection). zones_crs: CRS of points/geojson, e.g. "EPSG:27700" (BNG) or "EPSG:4326". labels: Optional labels for points (e.g. HER refs). band: 1-based band index to read. z_threshold: |z| at/above which a point is flagged anomalous (default 2.0). output_mode: "json" or "text".

Returns: Per-zone statistics, plus a local z-score when background_m is given.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bandNo
labelsNo
pointsNo
geojsonNo
buffer_mNo
zones_crsNoEPSG:4326
artifact_idYes
output_modeNojson
z_thresholdNo
background_mNo
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses return of per-zone statistics and optional z-score anomaly detection, explains the logic, and notes the raster must be a GeoTIFF. Side effects and auth are not mentioned, but the read-only nature is implied.

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 well-structured with a summary, zone explanation, anomaly section, and parameter list. It is front-loaded with purpose. While long, every sentence adds value. Minor redundancy in zone explanation but overall efficient.

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?

With 10 parameters, no output schema, and no annotations, the description covers all parameters, return values, and usage context. It mentions projection requirements and anomaly detection logic. Lack of explicit return format is compensated by clear per-zone statistics mention.

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 coverage is 0%, so description compensates fully. Each parameter is explained: points format, buffer_m meaning, geojson types, zones_crs examples, background_m enabling anomaly detection, etc. This adds substantial meaning beyond the schema types.

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 the tool reads raster values within zones, specifying it as the inference step after fetch. It distinguishes between buffer and polygon zones and gives concrete examples (NDVI index, GeoTIFF). This is specific and differentiates from sibling tools.

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?

The description provides clear context on when to use (after fetch, with stored raster artifacts) and explains two zone input modes. It implicitly excludes PNG previews and gives anomaly detection use case. While it doesn't explicitly name alternatives, the context makes usage clear.

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/IBM/chuk-mcp-stac'

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