Skip to main content
Glama

get_directions

Calculate step-by-step directions between two locations using the Multi-MCPs server, integrating multiple third-party APIs to provide accurate and unified navigation results.

Instructions

Get directions between origin and destination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationYes
originYes

Implementation Reference

  • The handler function that processes the tool call for get_directions, validates inputs, and delegates to the GoogleMapsClient.
    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); },
  • Input schema defining the required origin and destination string parameters for the get_directions tool.
    inputSchema: { type: "object", properties: { origin: { type: "string" }, destination: { type: "string" }, }, required: ["origin", "destination"], },
  • Tool registration entry in the registerGoogleMaps function, 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"], }, },
  • GoogleMapsClient helper method that performs the actual Google Directions API request.
    getDirections(origin: string, destination: string) { return this.request("/maps/api/directions/json", { query: { origin, destination, key: this.apiKey }, }); }

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