dk_reverse_geocode
Convert latitude/longitude coordinates to the nearest Danish address with full details for location-based applications and data analysis.
Instructions
Find the nearest Danish address to a given latitude/longitude coordinate. Returns the closest address with full details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Latitude (WGS84), e.g. 55.676 | |
| longitude | Yes | Longitude (WGS84), e.g. 12.568 |
Implementation Reference
- src/servers/danish-addresses.js:65-84 (handler)The implementation of the `dk_reverse_geocode` tool, which uses the DAWA API to find the nearest address for given coordinates.
server.tool( "dk_reverse_geocode", "Find the nearest Danish address to a given latitude/longitude coordinate. Returns the closest address with full details.", { latitude: z.number().min(54).max(58).describe("Latitude (WGS84), e.g. 55.676"), longitude: z.number().min(7).max(16).describe("Longitude (WGS84), e.g. 12.568"), }, async ({ latitude, longitude }) => { try { const data = await dawaFetch("/adgangsadresser/reverse", { x: longitude, y: latitude, struktur: "mini", }); return { content: [{ type: "text", text: formatAddress(data) }] }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true }; } } );