distance_matrix
Travel times (seconds) and road distances (metres) from each source to each destination among up to 25 places ([lng, lat] each), by car, truck, bike or on foot, in the shape of Mapbox Matrix v1: durations[i][j] and distances[i][j], null where no road joins a pair. Sources and destinations default to every point. For the nearest store to each customer, a delivery order, or a table of drive times. Counts one lookup per pair (sources times destinations) against the workspace's monthly searches, on every plan, all or nothing; past the plan it returns searches_exhausted and nothing is charged. Show the returned attribution with the results.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"points": "<points>"
},
"name": "distance_matrix"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key_id | No | The map key (uuid from list_keys) to count the lookups against. Default: the workspace's first active secret key, else its first publishable one. | |
| points | Yes | The places, each [lng, lat], 2 to 25. | |
| profile | No | driving (the default), driving-hgv (a truck), cycling or walking. | |
| sources | No | Which points to measure from, as indexes into points. Default: all of them. | |
| destinations | No | Which points to measure to, as indexes into points. Default: all of them. |