Skip to main content
Glama

Query an ArcGIS layer's features

query_layer

Filter ArcGIS FeatureServer or MapServer layers by attribute and/or spatial criteria, returning matching feature attributes and optional geometry as JSON. Use for targeted queries on GIS datasets.

Instructions

Run an attribute and/or spatial query against an ArcGIS FeatureServer/MapServer layer (e.g. OCC well points, tank sites) and return matching feature attributes (and optionally geometry) as JSON. Use get_layer_metadata first to see available fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whereNoSQL-style attribute filter, e.g. "COUNTY = 'OKLAHOMA'" or "STATUS = 'AC'". Defaults to 1=1 (all rows).
geometryNoOptional spatial filter geometry, e.g. 'xmin,ymin,xmax,ymax' envelope in WGS84 lon/lat.
layerUrlYesArcGIS REST layer URL, e.g. https://gis.occ.ok.gov/server/rest/services/Hosted/RBDMS_WELLS/FeatureServer/220
outFieldsNoComma-separated field names to return, or '*' for all (default).
spatialRelNoSpatial relationship, e.g. esriSpatialRelIntersects (default).
geometryTypeNoGeometry type for the 'geometry' param, e.g. esriGeometryEnvelope (default) or esriGeometryPoint.
orderByFieldsNoComma-separated field(s) to sort by, e.g. 'API_NUMBER ASC'.
returnGeometryNoWhether to include geometry (lat/lon) in results (default false).
resultRecordCountNoMax number of records to return (default 50).
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the return format (JSON), optional geometry inclusion, and the nature of querying (read-only is implied). It could mention error handling or response size limits, but the 'Use get_layer_metadata first' hint and example layer URLs add useful context beyond minimal.

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 two sentences long, front-loaded with the action, and every word contributes. It avoids redundancy while including examples and a usage hint, making it both concise and structured for quick scanning.

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 9 parameters and no output schema, the description covers the essential context: purpose, return type, and a prerequisite action. It does not mention output structure or error handling, but given the interactive schema and sibling context, it is reasonably complete.

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. The description adds a helpful pointer to get_layer_metadata for field discovery, but does not elaborate on parameter relationships or edge cases. This meets the baseline for high schema coverage without adding substantial extra meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs an attribute and/or spatial query against an ArcGIS FeatureServer/MapServer layer and returns matching features as JSON. It uses a specific verb 'Run' and identifies the resource (layer), examples (OCC well points, tank sites), and distinguishes from siblings by explicitly mentioning get_layer_metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit context for when to use this tool (attribute/spatial query) and instructs to use get_layer_metadata first to see available fields, which implies a prerequisite step. It does not explicitly mention when not to use it or compare with list_datasets/get_dataset, but the guidance is clear enough for typical use.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MSPFE2019/occ-gis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server