Skip to main content
Glama
robobobby
by robobobby

no_reverse_geocode

Find Norwegian addresses near geographic coordinates by specifying latitude, longitude, and search radius to locate nearby locations.

Instructions

Find Norwegian addresses near a geographic point (reverse geocoding). Returns addresses within the specified radius.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYesLatitude (WGS84, e.g. 59.911 for Oslo)
lonYesLongitude (WGS84, e.g. 10.750 for Oslo)
radiusNoSearch radius in meters (default 100, max 10000)
limitNoMax results (default 10)

Implementation Reference

  • The `no_reverse_geocode` tool implementation using the `apiFetch` helper to call the Kartverket Adresser API.
    server.tool(
      "no_reverse_geocode",
      "Find Norwegian addresses near a geographic point (reverse geocoding). Returns addresses within the specified radius.",
      {
        lat: z.number().describe("Latitude (WGS84, e.g. 59.911 for Oslo)"),
        lon: z.number().describe("Longitude (WGS84, e.g. 10.750 for Oslo)"),
        radius: z.number().min(1).max(10000).optional().describe("Search radius in meters (default 100, max 10000)"),
        limit: z.number().min(1).max(50).optional().describe("Max results (default 10)"),
      },
      async ({ lat, lon, radius, limit }) => {
        try {
          const data = await apiFetch("/punktsok", {
            lat,
            lon,
            radius: radius || 100,
            treffPerSide: limit || 10,
          });
          const total = data.metadata?.totaltAntallTreff || 0;
    
          if (!data.adresser?.length) {
            return { content: [{ type: "text", text: `No addresses found within ${radius || 100}m of ${lat}, ${lon}.` }] };
          }
    
          const lines = [`## Addresses near ${lat.toFixed(4)}°N, ${lon.toFixed(4)}°E (${radius || 100}m radius, ${total} total)\n`];
          for (const a of data.adresser) {
            const dist = a.meterDistanseTilPunkt;
            lines.push(formatAddress(a));
            if (dist != null) lines.push(`Distance: ${Math.round(dist)}m`);
            lines.push("");
          }
          lines.push(`*Kartverket Adresser API*`);
          return { content: [{ type: "text", text: lines.join("\n") }] };
        } catch (err) {
          return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/robobobby/mcp-nordic'

If you have feedback or need assistance with the MCP directory API, please join our Discord server