Skip to main content
Glama

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
NameRequiredDescriptionDefault
originYes
destinationYes

Implementation Reference

  • 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); },
  • 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"], }, },
  • 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 }, }); }
  • Top-level registration call to registerGoogleMaps(), which includes the 'get_directions' tool among others.
    registerGoogleMaps(),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TaylorChen/muti-mcps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server