Nearest Point
nearest_point_toolFind the nearest point in a collection to a target location, such as the closest store, stop, or landmark. Works offline without API calls.
Instructions
Find the nearest point in a collection to a given target point. More efficient than calling distance_tool for each candidate and sorting. Useful for finding the closest store, stop, or landmark to a location. Works offline without API calls.
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": {
"target": "<target>",
"points": "<points>"
},
"name": "nearest_point_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Distance units for the result | meters |
| points | Yes | Candidate points to search | |
| target | Yes | The reference point to measure from |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | Index of the nearest point in the input array | |
| units | Yes | Distance units | |
| nearest | Yes | The nearest point | |
| distance | Yes | Distance from target to nearest point |