Skip to main content
Glama

spatial_join

Idempotent

Join two spatial datasets using intersects, within, or contains predicates, with automatic engine selection and warnings for empty or non-overlapping results.

Instructions

Join by spatial predicate (intersects/within/contains).

engine='auto' routes to the fastest available engine for the inputs: SedonaDB (heavy joins, 10-180x) > DuckDB (GeoParquet fast path) > GeoPandas. A warnings key in the result flags an empty join or inputs whose extents do not overlap, each with a hint. Inputs without a CRS are refused.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
engineNoauto
left_pathYes
predicateNointersects
right_pathYes
output_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Install Server

TDQS

A4.7/5.0
Behavior5/5

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

The description adds rich behavioral details beyond annotations: engine routing precedence, a warnings key for empty or non-overlapping joins, and refusal of inputs lacking a CRS. These are non-obvious behaviors an agent could not infer from the schema or annotations, and there is no contradiction with the idempotentHint.

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 tight sentences with no filler. The core operation is front-loaded, followed by engine routing and key warnings, with every sentence contributing new information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter join tool, the description covers predicate choices, engine selection strategy, warning behavior, and a failure condition. An output schema is provided separately, so return values need not be described here. The definition is complete enough for an agent to invoke the tool correctly.

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 description coverage is 0%, so the description carries the burden. It explains engine values and predicate options in some detail, while left_path, right_path, and output_path are left to name inference. These names are self-explanatory, so the gap is minor.

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 opening sentence 'Join by spatial predicate (intersects/within/contains)' names the action, resource, and allowed predicates, which clearly distinguishes it from sibling tools like nearest_join and overlay_layers. An agent can immediately understand what operation is performed.

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 gives concrete guidance on engine selection, explaining when SedonaDB, DuckDB, or GeoPandas is preferred. It also states a hard precondition: inputs without a CRS are refused. It does not explicitly contrast this tool with nearest_join, but the predicate-based wording implies the appropriate use case.

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

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/mapsmith-ai/mapsmith'

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