dk_nearby_addresses
Find addresses within a specified radius of coordinates in Denmark to explore areas or discover nearby locations.
Instructions
Find addresses within a radius of a coordinate. Useful for exploring an area or finding what's around a location.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Center latitude | |
| longitude | Yes | Center longitude | |
| radius_meters | No | Search radius in meters (default 200, max 5000) | |
| limit | No | Max results (default 10) |
Implementation Reference
- src/servers/danish-addresses.js:154-171 (handler)Handler logic for dk_nearby_addresses, which fetches data from the DAWA API and formats the result.
async ({ latitude, longitude, radius_meters, limit }) => { try { const data = await dawaFetch("/adgangsadresser", { cirkel: `${longitude},${latitude},${radius_meters || 200}`, struktur: "mini", per_side: limit || 10, }); if (!data.length) return { content: [{ type: "text", text: "No addresses found within radius." }] }; const lines = data.map((a, i) => { const dist = haversine(latitude, longitude, a.y, a.x); return `${i + 1}. **${a.betegnelse}** (${dist}m away)\n ${a.y.toFixed(6)}°N, ${a.x.toFixed(6)}°E`; }); return { content: [{ type: "text", text: `## Addresses within ${radius_meters || 200}m\n\n${lines.join("\n")}` }] }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true }; } } ); - src/servers/danish-addresses.js:145-153 (registration)Registration of the dk_nearby_addresses tool with its schema definition using Zod.
server.tool( "dk_nearby_addresses", "Find addresses within a radius of a coordinate. Useful for exploring an area or finding what's around a location.", { latitude: z.number().min(54).max(58).describe("Center latitude"), longitude: z.number().min(7).max(16).describe("Center longitude"), radius_meters: z.number().min(1).max(5000).optional().describe("Search radius in meters (default 200, max 5000)"), limit: z.number().min(1).max(50).optional().describe("Max results (default 10)"), },