reverse_geocode
Convert geographic coordinates into Swiss addresses using swisstopo data. Provide latitude and longitude to retrieve location information.
Instructions
Convert coordinates to a Swiss address (swisstopo)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude (WGS84) | |
| lng | Yes | Longitude (WGS84) |
Implementation Reference
- src/modules/geodata.ts:183-197 (handler)The handler implementation for the 'reverse_geocode' tool, which fetches data from the swisstopo SearchServer.
case "reverse_geocode": { const lat = args.lat as number; const lng = args.lng as number; const url = buildUrl(`${BASE}/rest/services/api/SearchServer`, { searchText: `${lat},${lng}`, type: "locations", sr: 4326, limit: 5, }); const data = await fetchJSON<SearchResponse>(url); return JSON.stringify({ count: data.results.length, results: data.results.map(slimSearchResult), }); } - src/modules/geodata.ts:102-113 (schema)The input schema definition for the 'reverse_geocode' tool.
{ name: "reverse_geocode", description: "Convert coordinates to a Swiss address (swisstopo)", inputSchema: { type: "object", required: ["lat", "lng"], properties: { lat: { type: "number", description: "Latitude (WGS84)" }, lng: { type: "number", description: "Longitude (WGS84)" }, }, }, },