Skip to main content
Glama
GIS MCP Server
by mahdin75

focal_statistics

Calculates moving-window raster statistics—mean, min, max, or standard deviation—using a configurable pixel-width window for local spatial analysis.

Instructions

Moving-window statistic on a raster. statistic is mean, min, max, or std. size is the window width in pixels.

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": {
      "raster_path": "<raster_path>",
      "statistic": "<statistic>"
    },
    "name": "focal_statistics"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNo
statisticYes
output_pathNo
raster_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.16.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. Changed8 schema fields changedv1.0.0
    • addedInput schema / properties / output_path / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / output_path / title
      Removed value: -"Output Path"
    • removedInput schema / properties / output_path / type
      Removed value: -"string"
    • removedInput schema / properties / raster_path / title
      Removed value: -"Raster Path"
    • removedInput schema / properties / size / title
      Removed value: -"Size"
    • removedInput schema / properties / statistic / title
      Removed value: -"Statistic"
    • removedInput schema / title
      Removed value: -"focal_statisticsArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  3. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it says nothing about whether the result is written to disk, returned as an array, or both; nothing about edge/nodata handling; and nothing about performance or permissions. For a raster-processing mutation/derivation tool this leaves the agent guessing about the primary side effect.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the operation and followed by the two semantic details that matter. No filler or restatement of the name.

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, no output schema, and four undocumented parameters, the description must do more than it does. It omits the behavior of output_path (null vs. a path), the treatment of raster_path inputs, and what the caller receives back, which are exactly what an agent needs before invoking a raster derivation tool.

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 must compensate. It does add real value by enumerating the accepted statistic values (mean, min, max, std) where the schema merely declares an unconstrained string, and by defining size as window width in pixels. However, it says nothing about raster_path or about output_path, whose null default almost certainly switches between returning values and writing a file — an undocumented and consequential parameter.

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 specific operation and resource: a moving-window (focal) statistic over a raster, and it enumerates the supported statistics. The phrase 'moving-window' implicitly separates it from whole-raster or zonal aggregations, but it never names raster_band_statistics or zonal_statistics, so the agent must infer the distinction.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to choose this tool over raster_band_statistics or zonal_statistics, and no preconditions stated. The only usage signal is the implicit contrast between 'moving-window' and per-band or per-zone statistics.

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