Skip to main content
Glama

calculate_field

Write computed values to an attribute field in an ArcGIS Pro layer using Python, Arcade, or SQL expressions, so you can update areas, ratios, or other derived attributes.

Instructions

Calculate field values across a layer, e.g. expression "!Shape_Area! / 10000".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
map_nameNoMap to act on; defaults to the active map.
code_blockNoOptional helper function definitions.
expressionYesExpression.
field_nameYesField to write to.
layer_nameYesLayer or table name as shown by get_layers, or a full dataset path.
expression_typeNoPYTHON3, ARCADE or SQL.PYTHON3

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.1.1
    • addedInput schema / properties / code_block
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional helper function definitions.",
      +  "title": "Code Block"
      +}
    • addedInput schema / properties / expression / description
      Added value: +"Expression."
    • addedInput schema / properties / expression_type / description
      Added value: +"PYTHON3, ARCADE or SQL."
    • addedInput schema / properties / field_name / description
      Added value: +"Field to write to."
    • addedInput schema / properties / layer_name / description
      Added value: +"Layer or table name as shown by get_layers, or a full dataset path."
    • addedInput schema / properties / map_name / description
      Added value: +"Map to act on; defaults to the active map."
  2. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden, yet it discloses almost nothing. It doesn't state that this mutates layer data (a write operation likely requiring save_edits), which fields/rows are affected, permission needs, or reversibility. The expression example is illustrative but not behavioral.

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?

A single efficient sentence with an inline example that is front-loaded and wastes no words. It avoids padding but is arguably thin rather than over-long.

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?

An output schema exists, so return values needn't be explained, but with zero annotations on a data-mutating tool the description should disclose the write/save semantics and side effects it omits. For a 6-parameter geoprocessing-style tool, this leaves meaningful 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 the schema already documents all six parameters (map_name, code_block, expression, field_name, layer_name, expression_type). The description only adds expression syntax via the example, so 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?

States a specific verb (Calculate) and resource (field values) with concrete scope ('across a layer') and a sample expression, so the agent understands it computes values into fields. It does not, however, distinguish itself from siblings like add_field, alter_field, or update_features.

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?

No when-to-use or when-not-to-use guidance is given, and no alternatives are named. The agent must infer the context from the tool name alone.

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