Skip to main content
Glama

raster_calculator

Perform map algebra by binding rasters to aliases and writing Python expressions to compute new rasters. Requires Spatial Analyst.

Instructions

Map algebra. Bind rasters to short names, then write a Python expression over them. Requires the Spatial Analyst extension.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rastersYesAlias to layer name or path, e.g. {"dem": "elevation", "slp": "slope.tif"}.
map_nameNoMap to act on; defaults to the active map.
add_to_mapNoAdd the result to the map.
expressionYesExpression over the aliases, e.g. "(dem - 100) / slp". arcpy.sa functions such as Con, Abs and Log are available by name.
output_pathYesWhere to save the result raster.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.1

TDQS

A3.5/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 behavioral burden. It does add one genuinely valuable fact — the Spatial Analyst extension is required — but it omits that this is a write operation producing a persisted dataset, what happens on overwrite or failure, and whether it blocks/returns messages.

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, zero filler, with the core concept front-loaded and the prerequisite stated last. Nothing needs to be trimmed and nothing is buried.

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

Completeness3/5

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

Inputs are conceptually covered and an output schema exists, so return values need no explanation. However, for a five-parameter tool with a nested object and no annotations, the description says nothing about the write side effects on output_path or failure/overwrite behavior, leaving real gaps.

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 100%, so every parameter is already documented, including the alias-map example and the arcpy.sa function names. The description restates the relationship between the rasters aliases and the expression but adds no syntax or formatting detail beyond the schema, so the baseline 3 applies.

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?

"Map algebra. Bind rasters to short names, then write a Python expression over them" names the operation and the exact mechanism (alias binding + expression), which is more specific than the bare tool name. It does not, however, distinguish itself from siblings that could also do raster math, such as execute_arcpy_code or run_geoprocessing_tool.

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 by describing the workflow (bind rasters, then write an expression), but gives no explicit when to use this vs. execute_arcpy_code, zonal_statistics, or a generic geoprocessing tool, and names no alternatives. The Spatial Analyst statement is a prerequisite rather than a usage rule.

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