Skip to main content
Glama

nearest_join

Idempotent

Join each feature to its nearest neighbor from another layer and record the distance in meters. Distances are computed in an estimated UTM zone to avoid silent degree-based errors.

Instructions

Attach each feature's nearest neighbour from another layer, with the distance IN METERS in a named column.

Geographic-CRS inputs are measured in an estimated UTM zone (decision recorded in the manifest) and returned in the input CRS — a nearest distance in degrees is the classic silent error of this operation, and it cannot happen here. max_distance_meters drops pairs farther than that; an emptied result comes back with a warnings entry, never silently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
left_pathYes
right_pathYes
output_pathYes
distance_columnNonearest_distance_m
max_distance_metersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Install Server

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already signal idempotence and non-destructiveness; the description adds the critical CRS safety behavior—estimated UTM measurement for geographic inputs, return in input CRS, and prevention of the classic degrees error—plus the warnings entry on emptied results. This is exactly the behavioral context an agent needs.

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 operation is front-loaded in the first sentence, followed by two high-value caveats (CRS handling and max_distance behavior). No filler or repetition; every sentence earns its place.

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 join tool with an output schema and safety annotations, this is complete: it explains the operation, the main failure mode it prevents, the distance filter, and the warning behavior. Nothing material is missing for an agent to call it successfully.

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?

With 0% schema description coverage, the description must carry parameter meaning, and it does for distance_column (IN METERS, named) and max_distance_meters (drops pairs beyond threshold). left_path, right_path, and output_path are sufficiently clear from their names, though the description does not elaborate on them.

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?

States a specific operation: attach each feature's nearest neighbour from another layer and add a named distance column. The 'nearest neighbour' and 'distance in meters' wording sets it apart from the generic spatial_join sibling.

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

Usage Guidelines3/5

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

The description implies this is the tool for nearest-neighbour joins and describes conditions under which behavior changes (geographic CRS, max_distance_meters), but it never explicitly says when to use it instead of spatial_join or other siblings.

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