Skip to main content
Glama
AIWerk

Google Maps MCP Server

by AIWerk

maps_distance_matrix

Read-only

Calculate travel time and distance for multiple origins and destinations. Identify the closest depot to each customer or rank route options with results referencing your input arrays.

Instructions

Travel time and distance for every origin-destination pair, e.g. which of five depots is closest to a customer. Results carry originIndex and destinationIndex pointing back at the input arrays, and are not necessarily in order. Limit is 625 elements (origins x destinations), 100 for TRANSIT or TRAFFIC_AWARE_OPTIMAL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unitsNoUnits, default METRIC.
originsYesStart points. Each one: Address ("Bern main station"), coordinates ("46.9480,7.4474") or a place ID ("place_id:ChIJ...").
avoid_tollsNoAvoid toll roads (motorised modes only).
region_codeNoCLDR region code, e.g. "CH".
travel_modeNoTravel mode, default DRIVE.
destinationsYesEnd points. Each one: Address ("Bern main station"), coordinates ("46.9480,7.4474") or a place ID ("place_id:ChIJ...").
avoid_ferriesNoAvoid ferries (motorised modes only).
language_codeNoISO 639 language code, e.g. "de".
avoid_highwaysNoAvoid highways (motorised modes only).
departure_timeNoRFC 3339 UTC timestamp, e.g. "2026-08-13T07:30:00Z". Must be in the future.
routing_preferenceNoTraffic handling for DRIVE and TWO_WHEELER, default TRAFFIC_AWARE.
Behavior5/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds valuable non-obvious behavior: results are not necessarily in order, they carry originIndex/destinationIndex, and there are explicit element limits (625 general, 100 for transit/traffic-aware-optimal). These details go well beyond the annotation hints.

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?

Three sentences, each carrying distinct information: purpose, result structure/ordering, and limits. No filler or redundancy.

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?

The description covers purpose, an example, key output characteristics, and hard limits. It doesn't fully expand the result fields (e.g., duration and distance), but the first sentence implies those, and the output schema absence is mitigated by the clear 'travel time and distance' phrasing.

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 100% schema description coverage, the baseline is 3, but the description adds meaningful constraint: the product of origins and destinations is limited (625 max, 100 for certain modes). This gives practical semantics to the array parameters beyond what the schema states.

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 'Travel time and distance for every origin-destination pair,' which is a specific verb+resource statement and clearly differentiates this from single-route tools like maps_directions. The depot example reinforces the pairwise use case.

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 example 'which of five depots is closest to a customer' provides clear contextual guidance for when to use this tool. It doesn't explicitly name alternatives or exclusions, but the context is strong enough to convey the typical use case.

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/AIWerk/mcp-server-google-maps'

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