Skip to main content
Glama

matrix

Calculate travel times and distances between multiple origins and destinations in a single request, replacing hundreds of individual route calls for efficient logistics planning.

Instructions

Calculate travel times and distances between multiple origins and destinations in a single request.

Returns: { sources: [{lat,lon}], targets: [{lat,lon}], durations: [[sec,...]], distances: [[km,...]] } durations[i][j] = travel time in seconds from origin i to destination j. distances[i][j] = distance in km from origin i to destination j.

PERFORMANCE: Always prefer matrix over calling route in a loop. One matrix call replaces N×M individual route calls. LIMITS: Up to 50 origins × 50 destinations (2500 pairs) per call. USE FOR: Nearest-store finder, multi-stop delivery planning, logistics optimization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originsYesArray of origin {lat, lon} objects. Max 50.
destinationsYesArray of destination {lat, lon} objects. Max 50.
modeNoTravel mode. Default: auto.
unitsNoDistance units. Default: km.
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the return format (sources, targets, durations, distances), explains the matrix indexing, and specifies limits and performance benefits. However, it does not explicitly state whether the operation is read-only or if any side effects occur, which is a minor gap.

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 and well-structured: a clear opening statement, followed by output format, performance advice, limits, and use cases. Every sentence is informative without 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's complexity (4 parameters, no output schema), the description provides a complete picture: how to call it, what the output looks like, how to interpret indices, and why to prefer it over alternatives. No critical information is missing.

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%, and parameters are well-documented in the schema. The description adds value by explaining how to interpret the output arrays (durations[i][j] = travel time from origin i to destination j) and emphasizes defaults (auto, km). This enhances the agent's understanding 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 the verb and resource: 'Calculate travel times and distances between multiple origins and destinations in a single request.' It differentiates from the sibling 'route' tool by explicitly stating to prefer matrix over calling route in a loop, establishing its unique purpose for multi-pair computations.

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 provides explicit when-to-use guidance: 'Always prefer matrix over calling route in a loop' and 'One matrix call replaces N×M individual route calls.' It also lists specific use cases (nearest-store finder, multi-stop delivery planning) and limits (50x50), enabling clear decision-making.

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