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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"latitude": "<latitude>",
"longitude": "<longitude>"
},
"name": "dk_reverse_geocode"
}
}Input 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 }; } } );