Skip to main content
Glama
robobobby
by robobobby

dk_postal_code_lookup

Find the city, area, municipalities, and geographic boundaries for any 4-digit Danish postal code using Nordic regional data tools.

Instructions

Look up a Danish postal code to get the city/area name, bounding box, and associated municipalities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
postal_codeYes4-digit Danish postal code, e.g. '2200'

Implementation Reference

  • The handler for the 'dk_postal_code_lookup' tool, which fetches postal code data from the DAWA API and formats it into a text response.
    server.tool(
      "dk_postal_code_lookup",
      "Look up a Danish postal code to get the city/area name, bounding box, and associated municipalities.",
      {
        postal_code: z.string().regex(/^\d{4}$/).describe("4-digit Danish postal code, e.g. '2200'"),
      },
      async ({ postal_code }) => {
        try {
          const data = await dawaFetch(`/postnumre/${postal_code}`);
          const lines = [];
          lines.push(`## ${data.nr} ${data.navn}`);
          if (data.bbox) {
            lines.push(`**Bounding box:** ${data.bbox[1].toFixed(4)}°N to ${data.bbox[3].toFixed(4)}°N, ${data.bbox[0].toFixed(4)}°E to ${data.bbox[2].toFixed(4)}°E`);
          }
          if (data.kommuner && data.kommuner.length) {
            lines.push(`**Municipalities:** ${data.kommuner.map(k => `${k.navn} (${k.kode})`).join(", ")}`);
          }
          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