Skip to main content
Glama

Get trail geometry clipped to a box

get_route_segments

Get route geometry clipped to a WGS84 bounding box as GeoJSON. Specify route IDs, bounding box, and activity type to retrieve trail segments for a map viewport.

Instructions

Get the on-map geometry of one or more routes, clipped to a WGS84 lon/lat bounding box, as GeoJSON (reprojected to lon/lat). Useful for drawing the part of a trail inside a map viewport. Geometry is summarised by default; set geometry_detail to 'full' for all coordinates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesOSM relation ids whose geometry to return.
min_lonYesWestern longitude of the clip box.
min_latYesSouthern latitude of the clip box.
max_lonYesEastern longitude of the clip box.
max_latYesNorthern latitude of the clip box.
geometry_detailNoGeometry verbosity: 'none', 'summary' (default), or 'full'.summary
flavourNoWhich activity map to query: hiking, cycling, mtb (mountain biking), riding (horse), skating (inline), or slopes (ski/winter). Defaults to hiking.hiking
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that geometry is reprojected to lon/lat, clipped, and default summarization is used. However, it does not mention error handling, performance, or what happens with invalid inputs (e.g., out-of-bounds coordinates, missing routes). The behavior is adequately but not fully transparent.

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 sentences long, front-loads the main action, and includes a use case and a note about default behavior. Every sentence adds value, and there is no superfluous text.

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?

For a tool with 7 parameters, no output schema, and moderate complexity (clipping, reprojection), the description covers the output format (GeoJSON), the default behavior (summary), and the optional parameter (geometry_detail). It does not explain return value structure or error cases, but given the schema coverage, it is largely complete.

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?

The input schema has 100% description coverage, so the baseline is 3. The description reinforces that the bounding box parameters define the clip region and that geometry_detail defaults to 'summary', but it adds little new information beyond the schema descriptions. The mention of WGS84 and reprojection is helpful but not critical.

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 the tool retrieves on-map geometry of routes clipped to a bounding box, output as GeoJSON. The verb 'get' and resource 'route segments' are specific, and the description distinguishes it from siblings like find_routes_in_bbox (which finds routes) and get_route_details (which returns metadata).

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 provides a clear use case: 'drawing the part of a trail inside a map viewport.' This gives context for when to use the tool. However, it does not explicitly mention when not to use it or compare to alternatives like get_route_elevation or get_route_symbol, leaving some ambiguity for the agent.

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/chiraggahujaa/trails-mcp'

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