Skip to main content
Glama
TaylorChen

Multi-MCPs

by TaylorChen

geocode_address

Convert human-readable addresses into geographic coordinates (latitude/longitude) for mapping and location-based applications.

Instructions

Geocode a human-readable address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes

Implementation Reference

  • The main handler function for the 'geocode_address' tool. It validates the input address and delegates to the GoogleMapsClient's geocode method.
    async geocode_address(args: Record<string, unknown>) {
      if (!cfg.googleApiKey) throw new Error("GOOGLE_API_KEY is not configured");
      const address = String(args.address || "");
      if (!address) throw new Error("address is required");
      return client.geocode(address);
    },
  • Input schema definition for the 'geocode_address' tool, specifying the required 'address' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        address: { type: "string" },
      },
      required: ["address"],
    },
  • Tool registration object for 'geocode_address' within the Google Maps tools array, including name, description, and schema.
    {
      name: "geocode_address",
      description: "Geocode a human-readable address",
      inputSchema: {
        type: "object",
        properties: {
          address: { type: "string" },
        },
        required: ["address"],
      },
    },
  • Helper method in GoogleMapsClient class that performs the actual geocoding API request to Google Maps.
    geocode(address: string) {
      return this.request("/maps/api/geocode/json", {
        query: { address, 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