Skip to main content
Glama
muend

arcgis-mcp-bridge

update_legend

Add or remove a layer entry in a selected layout legend to synchronize legends with automated layer changes before exporting maps.

Instructions

Add or remove a layer entry in a selected layout legend using arcpy.mp legend addItem or removeItem. Use this to synchronize legends with automated layer changes before exporting maps. This modifies the layout legend and saves the .aprx project when save=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.3
    • changedInput schema / $defs / UpdateLegendInput / properties / aprx_path / description
      Previous value: -"Absolute .aprx path."New value: +"Absolute path to the saved ArcGIS Pro .aprx project file. The path must be inside a configured PathGuard allowed root. Tools operate on the saved project file, not a live open ArcGIS Pro session."
  2. Changed7 schema fields changedv1.0.1
    • addedInput schema / $defs / UpdateLegendInput / description
      Added value: +"Add or remove a layer entry in a selected layout legend."
    • addedInput schema / $defs / UpdateLegendInput / properties / action / description
      Added value: +"Legend operation to perform: ADD the layer or REMOVE it."
    • addedInput schema / $defs / UpdateLegendInput / properties / layer_name / description
      Added value: +"Name of the layer to add to or remove from the legend. The layer must exist in the target map frame."
    • changedInput schema / $defs / UpdateLegendInput / properties / layout_name / description
      Previous value: -"Layout name; None targets the first layout."New value: +"Name of the layout inside the .aprx project. Use None to target the first layout returned by ArcGIS Pro."
    • changedInput schema / $defs / UpdateLegendInput / properties / legend_name / description
      Previous value: -"Legend element name; None targets the first."New value: +"Name of the legend element to update. Use None to target the first legend in the selected layout."
    • addedInput schema / $defs / UpdateLegendInput / properties / map_frame / description
      Added value: +"Optional map frame name used to resolve the layer. Use None to target the first map frame in the selected layout."
    • addedInput schema / $defs / UpdateLegendInput / properties / save / description
      Added value: +"When true, save the .aprx project after updating the legend."
  3. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/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. It discloses that it modifies the layout legend and saves the .aprx project when save=true. It does not cover error conditions, permissions, or side effects, but the core behavior is adequately described.

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 three sentences, each serving a purpose: stating the action, suggesting use case, and noting the save behavior. No wasted words.

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?

Given that an output schema exists (handling return values) and annotations are absent, the description is mostly complete. It lacks explicit prerequisites (e.g., layout must exist), but the main purpose and behavior are well covered.

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?

The input schema already contains parameter descriptions, so the description adds minimal semantic value beyond stating the action (add/remove). With high schema coverage, a baseline of 3 is appropriate.

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 the tool adds or removes a layer entry in a layout legend using arcpy.mp methods. It distinguishes from siblings like add_layer_to_map by focusing on legend updates, not map layers. However, it does not explicitly contrast with similar legend tools.

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 says 'Use this to synchronize legends with automated layer changes before exporting maps,' which provides a clear use case. However, it lacks when-not-to-use guidance or explicit alternatives, leaving usage somewhat implied.

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