Skip to main content
Glama

match_trace

Snap a recorded GPS trace to the road network and say what it actually travelled over. Provide shape (2 to 2000 recorded points, oldest first) or encoded_polyline (the same trace as a polyline6 string) — not both — plus the costing it was travelled under: "auto" (default), "truck", "bicycle", "pedestrian" or "motor_scooter". Costing decides which roads the trace may match onto, so a walk matched as "auto" snaps to the carriageway rather than the footpath. Returns the matched path as geometry_polyline6 (the snapped roads, not your raw points) with its distance_m and duration_s, then the roll-ups: by_road_class and by_admin (distance and time, longest first), by_surface (distance), and toll, bridge and tunnel totals. This is how you turn a dashcam or telematics log into a report — which country and region the driving happened in, how much of it was motorway, how much was tolled, how much was unpaved. Honesty: the roll-ups are summed per matched road segment, so they need not add up to distance_m exactly, and segments the map records no surface or admin area for are left out of that breakdown rather than filed under a guess — an entry in by_admin with null codes is exactly that, counted and not attributed. Needs the MapMap gateway (GATEWAY_URL + GATEWAY_API_KEY); there is no direct-backend fallback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
shapeNoThe trace as an ordered list of recorded points, oldest first. Between 2 and 2000 points. Provide this or `encoded_polyline`.
costingNoCosting model the trace was travelled under: `auto` (default), `truck`, `bicycle`, `pedestrian` or `motor_scooter`. It decides which roads the trace may be matched onto, so a walked trace matched as `auto` snaps to the carriageway rather than the path.
encoded_polylineNoThe trace as a Google encoded polyline with six digits of decimal precision (polyline6) — the geometry `route` and `match_trace` themselves return. Provide this or `shape`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tollYesTolled portion of the matched path.
bridgeYesBridge portion of the matched path.
tunnelYesTunnel portion of the matched path.
costingYesCosting the trace was matched under.
summaryYesOne-line human summary of the match, for reading aloud.
by_adminYesDistance and time by administrative area, longest first. An entry whose codes are all null covers segments the graph could not place in any admin area — counted honestly rather than guessed at.
by_surfaceYesDistance by road surface (`paved`, `paved_smooth`, `gravel`, …), longest first. Empty when the graph records no surface for any matched segment.
distance_mYesLength of the matched path in metres.
duration_sYesTravel time along the matched path in seconds, from the engine's own time model.
edge_countYesHow many road segments the trace matched onto.
by_road_classYesDistance and time by road class (`motorway`, `primary`, `residential`, …), longest first.
geometry_polyline6YesThe matched path as a Google encoded polyline with six digits of decimal precision (polyline6). This is the trace snapped to real roads, not the raw input.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / $defs / LatLon / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "lat": {
      +        "description": "Latitude in decimal degrees (−90 to 90).",
      +        "format": "double",
      +        "type": "number"
      +      },
      +      "lon": {
      +        "description": "Longitude in decimal degrees (−180 to 180).",
      +        "format": "double",
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "lat",
      +      "lon"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "GeoJSON position [lon, lat]: longitude FIRST.",
      +    "items": {
      +      "format": "double",
      +      "type": "number"
      +    },
      +    "maxItems": 2,
      +    "minItems": 2,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / $defs / LatLon / description
      Previous value: -"A WGS84 coordinate pair in decimal degrees."New value: +"A WGS84 coordinate in decimal degrees: a {lat, lon} object (preferred), or a GeoJSON [lon, lat] array with LONGITUDE FIRST, the same order as every polygon field on this server."
    • removedInput schema / $defs / LatLon / properties
      Removed value: -{
      -  "lat": {
      -    "description": "Latitude in decimal degrees (−90 to 90).",
      -    "format": "double",
      -    "type": "number"
      -  },
      -  "lon": {
      -    "description": "Longitude in decimal degrees (−180 to 180).",
      -    "format": "double",
      -    "type": "number"
      -  }
      -}
    • removedInput schema / $defs / LatLon / required
      Removed value: -[
      -  "lat",
      -  "lon"
      -]
    • removedInput schema / $defs / LatLon / type
      Removed value: -"object"
  2. Added

TDQS

A4.6/5.0
Behavior5/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 of behavioral disclosure, and it does so thoroughly. It explains what is returned (snapped roads, not raw points), the roll-up caveat that segments need not sum exactly to distance_m, that unknown admin/surface areas are omitted rather than guessed, and the hard dependency on the MapMap gateway with no fallback. This is exemplary transparency for a complex tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but information-dense; every sentence adds operational or semantic value, including the honesty caveat and gateway requirement. It front-loads the core purpose and then layers in invocation details, output semantics, and limitations. Slightly verbose, but no filler—each clause 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 tool with three parameters, no annotations, and a rich output schema, the description is complete: it covers input formats, parameter interplay, output symbols, aggregation caveats, unknown-value handling, and the required gateway configuration. An agent has enough context to call it correctly and interpret results, even without the output schema in front of it.

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 the baseline is 3, and the description adds genuine meaning beyond the schema. It clarifies that costing determines which roads the trace may match onto with a concrete example, explicitly says 'not both' for shape/encoded_polyline, and defines encoded_polyline as polyline6, the same format route and match_trace return. That extra context helps invocation without redundancy.

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 opens with a specific verb and resource: 'Snap a recorded GPS trace to the road network' and clearly explains the output is the matched path plus road-class and admin roll-ups. It explicitly distinguishes use from route planning by framing it as 'a dashcam or telematics log into a report', making it easy to tell apart from siblings like route or route_observations.

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 clear usage context: when you have a recorded trace and want to know what roads it travelled, with concrete costing guidance (a walked trace matched as 'auto' snaps to the carriageway rather than the footpath). It does not explicitly name sibling alternatives or state when not to use this tool, but the input-vs-route framing is clear enough to route an agent correctly.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources