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
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes |
Implementation Reference
- src/apis/maps/google.ts:87-92 (handler)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); },
- src/apis/maps/google.ts:63-69 (schema)Input schema definition for the 'geocode_address' tool, specifying the required 'address' string parameter.inputSchema: { type: "object", properties: { address: { type: "string" }, }, required: ["address"], },
- src/apis/maps/google.ts:60-70 (registration)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"], }, },
- src/apis/maps/google.ts:24-28 (helper)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 }, }); }