maps_distance_matrix

Pack: google_maps · Endpoint: https://gateway.pipeworx.io/google_maps/mcp

Calculate travel distance and time between multiple location pairs. Returns matrix with distances and durations for specified mode: driving, walking, transit, or biking.

Parameters

NameTypeRequiredDescription
originsstringyesPipe-separated origins (e.g., “New York|Boston”)
destinationsstringyesPipe-separated destinations (e.g., “Philadelphia|Washington DC”)
modestringnoTravel mode: driving, walking, bicycling, transit
_apiKeystringyesGoogle Maps API key

Example call

Arguments

{
  "origins": "New York|Los Angeles",
  "destinations": "Chicago|Houston",
  "_apiKey": "your-google_maps-api-key"
}

curl

curl -X POST https://gateway.pipeworx.io/google_maps/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"maps_distance_matrix","arguments":{"origins":"New York|Los Angeles","destinations":"Chicago|Houston","_apiKey":"your-google_maps-api-key"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('maps_distance_matrix', {
  "origins": "New York|Los Angeles",
  "destinations": "Chicago|Houston",
  "_apiKey": "your-google_maps-api-key"
});

More examples

{
  "origins": "40.7128,-74.0060|34.0522,-118.2437",
  "destinations": "41.8781,-87.6298",
  "mode": "transit",
  "_apiKey": "your-google_maps-api-key"
}

Response shape

FieldTypeDescription
rowsarrayDistance/duration for each origin-destination pair
origin_addressesarrayGeocoded origin addresses
destination_addressesarrayGeocoded destination addresses
statusstringStatus of the distance matrix request
Full JSON Schema
{
  "type": "object",
  "properties": {
    "rows": {
      "type": "array",
      "description": "Distance/duration for each origin-destination pair",
      "items": {
        "type": "object",
        "properties": {
          "elements": {
            "type": "array",
            "description": "Elements for each destination from this origin",
            "items": {
              "type": "object",
              "properties": {
                "distance": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "Human-readable distance"
                    },
                    "value": {
                      "type": "number",
                      "description": "Distance in meters"
                    }
                  }
                },
                "duration": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "Human-readable duration"
                    },
                    "value": {
                      "type": "number",
                      "description": "Duration in seconds"
                    }
                  }
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "OK",
                    "NOT_FOUND",
                    "ZERO_RESULTS",
                    "MAX_ROUTE_LENGTH_EXCEEDED"
                  ],
                  "description": "Status for this element"
                }
              }
            }
          }
        }
      }
    },
    "origin_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Geocoded origin addresses"
    },
    "destination_addresses": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Geocoded destination addresses"
    },
    "status": {
      "type": "string",
      "enum": [
        "OK",
        "INVALID_REQUEST",
        "MAX_ELEMENTS_EXCEEDED",
        "OVER_QUERY_LIMIT",
        "REQUEST_DENIED",
        "UNKNOWN_ERROR"
      ],
      "description": "Status of the distance matrix request"
    }
  }
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "google_maps": {
      "url": "https://gateway.pipeworx.io/google_maps/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026