Skip to main content
Glama
robobobby
by robobobby

dk_address_search

Search Danish addresses using text queries to find locations with coordinates for autocomplete and validation purposes.

Instructions

Search for Danish addresses by free-text query (street name, full address, postal code + city). Returns matching addresses with coordinates. Great for autocomplete and address validation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesAddress search text, e.g. 'Nørrebrogade 1, København' or 'Ølsemagle Strand'
limitNoMax results (default 10)
municipalityNoFilter by municipality code (e.g. '0101' for Copenhagen)
postal_codeNoFilter by postal code (e.g. '2200')

Implementation Reference

  • The handler function for dk_address_search, which constructs query parameters and fetches data from the DAWA API.
    async ({ query, limit, municipality, postal_code }) => {
      try {
        const params = { q: query, struktur: "mini", per_side: limit || 10 };
        if (municipality) params.kommunekode = municipality;
        if (postal_code) params.postnr = postal_code;
        const data = await dawaFetch("/adresser", params);
        return { content: [{ type: "text", text: formatAddressList(data) }] };
      } catch (err) {
        return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
      }
    }
  • Input schema for dk_address_search, defining query, limit, municipality, and postal_code parameters using zod.
    {
      query: z.string().describe("Address search text, e.g. 'Nørrebrogade 1, København' or 'Ølsemagle Strand'"),
      limit: z.number().min(1).max(50).optional().describe("Max results (default 10)"),
      municipality: z.string().optional().describe("Filter by municipality code (e.g. '0101' for Copenhagen)"),
      postal_code: z.string().optional().describe("Filter by postal code (e.g. '2200')"),
    },
  • Registration of the dk_address_search tool using the server.tool method.
    server.tool(
      "dk_address_search",
      "Search for Danish addresses by free-text query (street name, full address, postal code + city). Returns matching addresses with coordinates. Great for autocomplete and address validation.",
      {
        query: z.string().describe("Address search text, e.g. 'Nørrebrogade 1, København' or 'Ølsemagle Strand'"),
        limit: z.number().min(1).max(50).optional().describe("Max results (default 10)"),
        municipality: z.string().optional().describe("Filter by municipality code (e.g. '0101' for Copenhagen)"),
        postal_code: z.string().optional().describe("Filter by postal code (e.g. '2200')"),
      },
      async ({ query, limit, municipality, postal_code }) => {
        try {
          const params = { q: query, struktur: "mini", per_side: limit || 10 };
          if (municipality) params.kommunekode = municipality;
          if (postal_code) params.postnr = postal_code;
          const data = await dawaFetch("/adresser", params);
          return { content: [{ type: "text", text: formatAddressList(data) }] };
        } 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