Skip to main content
Glama

set_definition_query

Apply a SQL WHERE clause to filter features on an ArcGIS Pro layer, or clear the filter with an empty string.

Instructions

Set a layer's definition query (SQL where clause). Empty string clears it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSQL where clause, e.g. "POP > 10000".
map_nameNoMap to act on; defaults to the active map.
layer_nameYesLayer or table name as shown by get_layers, or a full dataset path.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.1.1
    • 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."
    • addedInput schema / properties / query / description
      Added value: +"SQL where clause, e.g. \"POP > 10000\"."
  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 full burden. It reveals one useful behavioral detail (empty string clears), but omits whether this requires an active map, affects the underlying data, persists after saving, or requires specific permissions. For a mutation tool with zero annotation coverage, this is a significant gap.

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?

Two short sentences with zero waste. The core action is front-loaded, and the clearing behavior follows immediately. Nothing could be removed without losing information.

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?

For a mutation tool with no annotations but a rich output schema, the description should do more. It doesn't cover permissions, persistence, interaction with save_project, or error conditions (e.g., invalid SQL). The output schema exists, so return value explanation isn't needed, but critical behavioral context is missing.

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 parameters including format examples for 'query'. The description adds the empty-string-clears semantic for 'query', which marginally supplements the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 (set) and resource (layer's definition query) with the clarifying parenthetical '(SQL where clause)'. This is clearly distinguishable from siblings like set_layer_renderer or set_layer_labeling, though it doesn't explicitly contrast with any sibling.

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?

The description notes that an empty string clears the query, which implicitly covers how to remove a definition query. However, no explicit when-to-use guidance, prerequisites, or alternatives are mentioned. An agent gets no signal about when this tool is preferable or what conditions matter.

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