Skip to main content
Glama

nearest_road

Snap any GPS coordinate to the nearest drivable road. Returns snapped location and distance, enabling accurate route calculation and recovery from off-road waypoints.

Instructions

Find the nearest point on the road network to a given coordinate.

Returns: { lat, lon, distance_m (distance from input to snapped point), road_name }.

WHEN TO USE: Snap waypoints to routable roads before calling route. Also call this if route returns "no route found" — the waypoint may be in a park, building, or off-road area. RECOVERY: If route fails, call nearest_road on origin and destination, then retry route with snapped coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude. Range: -90 to 90.
lonYesLongitude. Range: -180 to 180.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It transparently describes the output fields (lat, lon, distance_m, road_name) and the snapping behavior. It could mention error cases but overall is clear.

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 concise, front-loads the purpose, then provides output format and usage guidelines. Every sentence adds value with no redundancy.

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?

Given the tool has 2 simple parameters and no output schema, the description compensates by listing return fields and providing recovery steps. It is complete for an agent to use 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 coverage is 100%, so baseline is 3. The description adds context by explaining that the lat/lon are used as an input coordinate to snap to the nearest road, which adds value beyond the schema.

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 'Find the nearest point on the road network to a given coordinate,' specifying the verb (find), resource (nearest point on road network), and input (coordinate). It distinguishes from siblings like geocode and route.

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 provides 'WHEN TO USE' and 'RECOVERY' guidance, stating to snap waypoints before route and to use if route fails. This offers clear context and alternative usage.

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/algolayertechnologies/mapsi-mcp'

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