Skip to main content
Glama

geom_relate

Read-onlyIdempotent

Check spatial relationships between geometries: point-in-polygon, overlap, containment, adjacency, distance, nearest points. For geofence checks, territory assignment, proximity screening.

Instructions

Test the spatial relationship between two geometries.

Answers point-in-polygon, overlap, containment and adjacency in one call, plus the shortest geodesic distance between them and the nearest point on each. Use this for geofence checks ("is this vehicle inside the zone?"), territory assignment and proximity screening.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojson_aYesFirst geometry, as GeoJSON (object or string) or WKT.
geojson_bYesSecond geometry, as GeoJSON (object or string) or WKT.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
metaYes
distance_mYes
relationshipsYes
nearest_pointsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds behavioral value by disclosing that the tool returns multiple relationship types plus geodesic distance and nearest points in one call, which is beyond what annotations provide. It doesn't mention error behavior or edge cases, but the annotations carry the main safety burden.

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?

Three sentences with zero waste. The core purpose is front-loaded, the output scope is summarized in the second sentence, and concrete use cases close it out. Every sentence earns its place.

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?

The description is complete for a read-only relationship-testing tool with a rich output schema. It covers what the tool does, what it returns, and when to use it. The only minor gap is not mentioning whether the input geometries must be in the same CRS or how invalid geometries are handled, but the output schema and annotations cover most operational needs.

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 both parameters as GeoJSON or WKT. The description adds the semantic context that these are two geometries being tested for relationships, but doesn't add format details beyond the schema. Baseline 3 is appropriate since the schema does the heavy lifting.

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 names a specific verb ('test') and resource ('spatial relationship between two geometries'), then enumerates the exact relationship types (point-in-polygon, overlap, containment, adjacency) plus distance and nearest-point outputs. This clearly distinguishes it from sibling tools like geom_measure (measurement) and geom_overlay (spatial operations).

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

Usage Guidelines5/5

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

The description explicitly lists use cases: geofence checks, territory assignment, and proximity screening. It also implicitly distinguishes from siblings by focusing on relationship testing rather than coordinate conversion, transformation, or measurement. The 'Use this for' phrasing gives concrete when-to-use guidance.

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