Driving distance
Use after geocoding two addresses. Results are estimates from the public OSRM demo server — fine for guidance, not guaranteed SLAs.
What this tool does
Travel time and distance often decide the price of a home visit or delivery. This tool asks the public OSRM routing server for the driving route between two points and returns the distance and an estimated drive time. Use it after the geocode tool has turned both addresses into coordinates. The public server is a demo service without uptime guarantees, so treat results as guidance and keep your own pricing rules in the prompt, for example a call-out fee above a certain distance.
Example conversation
Customer
How far is your clinic from Bandra West? I want to know how long it takes.
Tool callcalculate_distance
clinic coordinates → Bandra West coordinates
AI agent
By car it is about 9 km, usually around 25 minutes outside rush hour.
Customer
Okay, and is there parking?
AI agent
Yes, there is free parking in the building basement. Would you like a morning or afternoon appointment?
Example only. Tool calls are shown so you can see when the agent uses this template. Your agent’s wording depends on your prompt and business information.
Who uses it
- Home service businesses adding a travel fee based on driving distance.
- Clinics and salons telling customers how long the trip will take.
- Moving, delivery and catering companies estimating travel for a quote.
Setup
- Open Create agent or Edit agent and add a custom tool.
- Copy the fields below into the form. No API key is required.
- In your prompt, tell the agent to geocode both locations first, then call calculate_distance with the coordinates.
Copy into custom tool form
Copy each value into the matching field when you add a custom tool on the create or edit agent page. Replace any YOUR_… placeholders with your real credentials.
Tool name
Description
Endpoint URL
Paste into Endpoint URL (https:// is added automatically).
HTTP method
Tool inputs (all)
Tool input: start_lon
Input name
Input type
Input description
Reference value
Use this as the request query or body value and choose “Tool input” in the form.
Tool input: start_lat
Input name
Input type
Input description
Reference value
Use this as the request query or body value and choose “Tool input” in the form.
Tool input: end_lon
Input name
Input type
Input description
Reference value
Use this as the request query or body value and choose “Tool input” in the form.
Tool input: end_lat
Input name
Input type
Input description
Reference value
Use this as the request query or body value and choose “Tool input” in the form.
Request query (all)
Field name
Field value
Field name
Field value
Field name
Field value
Field name
Field value
Field name
Field value
