get_directions
Calculate routes between two locations using the Multi-MCPs server's integrated mapping service.
Instructions
Get directions between origin and destination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| origin | Yes | ||
| destination | Yes |
Implementation Reference
- src/apis/maps/google.ts:80-86 (handler)The handler function for the 'get_directions' tool. It validates the origin and destination arguments and delegates to the GoogleMapsClient.getDirections method.async get_directions(args: Record<string, unknown>) { if (!cfg.googleApiKey) throw new Error("GOOGLE_API_KEY is not configured"); const origin = String(args.origin || ""); const destination = String(args.destination || ""); if (!origin || !destination) throw new Error("origin and destination are required"); return client.getDirections(origin, destination); },
- src/apis/maps/google.ts:48-59 (registration)Registration of the 'get_directions' tool within the Google Maps API registration, including name, description, and input schema.{ name: "get_directions", description: "Get directions between origin and destination", inputSchema: { type: "object", properties: { origin: { type: "string" }, destination: { type: "string" }, }, required: ["origin", "destination"], }, },
- src/apis/maps/google.ts:18-22 (helper)Helper method on GoogleMapsClient that performs the actual API request to Google Directions API.getDirections(origin: string, destination: string) { return this.request("/maps/api/directions/json", { query: { origin, destination, key: this.apiKey }, }); }
- src/tools/register.ts:24-24 (registration)Top-level registration call to registerGoogleMaps(), which includes the 'get_directions' tool among others.registerGoogleMaps(),