Skip to main content
Glama
nkarasiak

QGIS MCP

by nkarasiak

Raster Calculator

raster_calculator

Perform raster band math using QGIS expressions, referencing layers as 'name@band', and write results as GeoTIFF.

Instructions

Band math via the QGIS raster calculator. Reference loaded raster layers in the expression as 'LayerName@band' (e.g. '("dem@1" > 1000) * 1'). Writes a GeoTIFF to output_path. Output grid, extent and CRS taken from reference_layer (layer id or name), defaulting to the first loaded file-based raster.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
output_pathYes
reference_layerNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral disclosure burden. It explicitly reveals that it writes a GeoTIFF, that output grid/extent/CRS come from reference_layer, and that the default is the first loaded file-based raster. It does not mention failure or overwrite behavior, but the main side effects are clear.

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?

The description is compact and front-loaded: purpose first, then a concrete expression example, then output and georeferencing behavior. Every sentence adds necessary value with no filler.

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 tool with no annotations, no output schema, and minimal parameter schema, the description provides the essential invocation details: expression format, output path, and georeferencing source. Minor gaps remain around error handling and overwrite behavior, but the core usage is sufficiently covered.

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 must explain the parameters, and it fully does. It explains expression syntax with a concrete 'LayerName@band' example, identifies output_path as the GeoTIFF destination, and describes reference_layer's role including id/name and default behavior.

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 clearly states that this performs band math via the QGIS raster calculator and writes a GeoTIFF. It is specific about the verb, resource, and output, but it does not explicitly name or contrast sibling tools like field_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 context is implied: use it for raster band math, reference loaded layers with 'LayerName@band', and provide an output path. However, it does not state when to prefer this over alternatives such as execute_processing or field_calculator, nor does it give exclusions.

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

Deploy Server

Other Tools