Skip to main content
Glama

spatial_filter

Filter features by spatial relationship—intersects, within, contains, touches, crosses, overlaps, or disjoint—against another layer, a bounding box, or a GeoJSON geometry.

Instructions

Spatial predicate filter: features of layer that intersect / are within / contain / touch / cross / overlap / are disjoint from (a) features of another layer (other_layer + other_filters), (b) a bbox [min_lon,min_lat,max_lon,max_lat], or (c) a GeoJSON geometry. Example: pois within the polygon 'Central Park'. Ask the user if the second operand is unclear.

Input Schema

NameRequiredDescriptionDefault
bboxNo[min_lon, min_lat, max_lon, max_lat] in WGS84.
layerYes
limitNoMax rows to return (default 100; server-side cap applies).
columnsNoAttribute columns to return (default: all non-geometry).
filtersNoAttribute filters on the layer, combined with AND.
geometryNo'auto' (default): full geometry if small, else representative points; 'full'; 'centroid'; 'none' (attributes only). The complete geometry is always kept server-side under result_id for render_map.auto
relationNointersects
other_layerNo
other_filtersNoFilters selecting the features of other_layer.
geojson_geometryNoA GeoJSON geometry object in WGS84.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does reveal the predicate semantics and the fact that a second operand is required in one of three forms, but it never states that the tool is read-only, what happens if more than one operand is provided, that results are row-limited (the limit default and server cap appear only in the schema), or how the returned result relates to render_map/result_id. Those are meaningful gaps for a 10-parameter tool with zero annotation coverage.

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 core capability and the three operand options come first, followed by a short example and one practical instruction; the parentheticals only disambiguate parameter pairings and nothing is redundant with the rest of the text.

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?

For a tool with ten parameters, nested Filter objects and no output schema, the description covers operand selection well but omits operand exclusivity rules, the shape of the returned rows, and how server-side geometry/result_id feeds render_map. Workable, but an agent could still mis-invoke it by passing two operands or expecting geometries it will not receive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 70%, and the description compensates for the weakest part: the `relation` enum is given plain-language meaning ('intersect / are within / contain / touch / cross / overlap / are disjoint from') and the three mutually alternative operand paths are explained with concrete examples. The remaining parameters (limit, columns, filters, geometry) are adequately documented in the schema, so little is lost.

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 opens with a specific verb and resource ('Spatial predicate filter: features of `layer`'), then enumerates the full relation vocabulary and the three alternative operands, so the agent knows exactly what this tool computes and can distinguish it from siblings such as spatial_join or within_distance without opening any schema.

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?

It gives concrete usage context: the three ways to supply the second operand (other_layer + other_filters, bbox, or a GeoJSON geometry), a worked example ('pois within the polygon Central Park'), and the instruction to ask the user when the second operand is ambiguous. It stops short of explicitly routing away from siblings (e.g. when to prefer within_distance or spatial_join instead).

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