Skip to main content
Glama
reidar80

Norwegian Business Registry MCP Server

by reidar80

get_municipality

Retrieve detailed municipality information from the Norwegian Business Registry using a 4-digit municipality number.

Instructions

Get information about a specific Norwegian municipality

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kommunenummerYes4-digit municipality number (e.g., '0301' for Oslo)

Implementation Reference

  • Dispatches the get_municipality tool call: extracts the municipality number from arguments, fetches data via apiClient, and returns it as JSON text content.
    case "get_municipality":
      const { kommunenummer } = request.params.arguments as { kommunenummer: string };
      const municipality = await apiClient.getMunicipality(kommunenummer);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(municipality, null, 2),
          },
        ],
      };
  • Defines the tool schema in the listTools response, including name, description, and input schema requiring 'kommunenummer' string.
      name: "get_municipality",
      description: "Get information about a specific Norwegian municipality",
      inputSchema: {
        type: "object",
        properties: {
          kommunenummer: { type: "string", description: "4-digit municipality number (e.g., '0301' for Oslo)" }
        },
        required: ["kommunenummer"]
      }
    },
  • BrregApiClient method that performs the HTTP request to fetch municipality data from BRREG API using the provided municipality number.
    async getMunicipality(municipalityNumber: string) {
      return this.makeRequest(`/enhetsregisteret/api/kommuner/${municipalityNumber}`);
  • Registers the get_municipality tool by including it in the tools list returned by ListToolsRequest handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "search_entities",
            description: "Search for Norwegian business entities (hovedenheter) with various filters",
            inputSchema: {
              type: "object",
              properties: {
                navn: { type: "string", description: "Entity name (1-180 characters)" },
                navnMetodeForSoek: { type: "string", enum: ["FORTLOEPENDE"], description: "Search method for name parameter" },
                organisasjonsnummer: { type: "array", items: { type: "string" }, description: "List of organization numbers (9 digits)" },
                overordnetEnhet: { type: "string", description: "Parent entity organization number" },
                fraAntallAnsatte: { type: "number", description: "Minimum number of employees" },
                tilAntallAnsatte: { type: "number", description: "Maximum number of employees" },
                konkurs: { type: "boolean", description: "Whether entity is bankrupt" },
                registrertIMvaregisteret: { type: "boolean", description: "Registered in VAT registry" },
                registrertIForetaksregisteret: { type: "boolean", description: "Registered in business registry" },
                registrertIStiftelsesregisteret: { type: "boolean", description: "Registered in foundation registry" },
                registrertIFrivillighetsregisteret: { type: "boolean", description: "Registered in voluntary organization registry" },
                underTvangsavviklingEllerTvangsopplosning: { type: "boolean", description: "Under forced liquidation" },
                underAvvikling: { type: "boolean", description: "Under liquidation" },
                underKonkursbehandling: { type: "boolean", description: "Under bankruptcy proceedings" },
                organisasjonsform: { type: "array", items: { type: "string" }, description: "Organizational forms" },
                hjemmeside: { type: "string", description: "Website" },
                kommunenummer: { type: "array", items: { type: "string" }, description: "Municipality numbers" },
                naeringskode: { type: "array", items: { type: "string" }, description: "Industry codes" },
                size: { type: "number", description: "Page size (default 20)" },
                page: { type: "number", description: "Page number" },
                sort: { type: "string", description: "Sort field and order (e.g., 'navn,ASC')" }
              }
            }
          },
          {
            name: "get_entity",
            description: "Get detailed information about a specific Norwegian business entity",
            inputSchema: {
              type: "object",
              properties: {
                organisasjonsnummer: { type: "string", description: "9-digit organization number" }
              },
              required: ["organisasjonsnummer"]
            }
          },
          {
            name: "get_entity_roles",
            description: "Get all roles for a specific entity",
            inputSchema: {
              type: "object",
              properties: {
                organisasjonsnummer: { type: "string", description: "9-digit organization number" }
              },
              required: ["organisasjonsnummer"]
            }
          },
          {
            name: "search_sub_entities",
            description: "Search for Norwegian business sub-entities (underenheter) with various filters",
            inputSchema: {
              type: "object",
              properties: {
                navn: { type: "string", description: "Sub-entity name (1-180 characters)" },
                navnMetodeForSoek: { type: "string", enum: ["FORTLOEPENDE"], description: "Search method for name parameter" },
                organisasjonsnummer: { type: "array", items: { type: "string" }, description: "List of organization numbers (9 digits)" },
                overordnetEnhet: { type: "string", description: "Parent entity organization number" },
                fraAntallAnsatte: { type: "number", description: "Minimum number of employees" },
                tilAntallAnsatte: { type: "number", description: "Maximum number of employees" },
                registrertIMvaregisteret: { type: "boolean", description: "Registered in VAT registry" },
                fraOppstartsdato: { type: "string", description: "Start date from (ISO-8601 yyyy-MM-dd)" },
                tilOppstartsdato: { type: "string", description: "Start date to (ISO-8601 yyyy-MM-dd)" },
                fraDatoEierskifte: { type: "string", description: "Ownership change date from (ISO-8601 yyyy-MM-dd)" },
                tilDatoEierskifte: { type: "string", description: "Ownership change date to (ISO-8601 yyyy-MM-dd)" },
                fraNedleggelsesdato: { type: "string", description: "Closure date from (ISO-8601 yyyy-MM-dd)" },
                tilNedleggelsesdato: { type: "string", description: "Closure date to (ISO-8601 yyyy-MM-dd)" },
                organisasjonsform: { type: "array", items: { type: "string" }, description: "Organizational forms" },
                hjemmeside: { type: "string", description: "Website" },
                kommunenummer: { type: "array", items: { type: "string" }, description: "Municipality numbers" },
                naeringskode: { type: "array", items: { type: "string" }, description: "Industry codes" },
                size: { type: "number", description: "Page size (default 20)" },
                page: { type: "number", description: "Page number" },
                sort: { type: "string", description: "Sort field and order" }
              }
            }
          },
          {
            name: "get_sub_entity",
            description: "Get detailed information about a specific Norwegian business sub-entity",
            inputSchema: {
              type: "object",
              properties: {
                organisasjonsnummer: { type: "string", description: "9-digit organization number" }
              },
              required: ["organisasjonsnummer"]
            }
          },
          {
            name: "get_organizational_forms",
            description: "Get all organizational forms used in the Norwegian business registry",
            inputSchema: {
              type: "object",
              properties: {
                sort: { type: "string", description: "Sort order (ASC/DESC)" },
                size: { type: "number", description: "Page size" },
                page: { type: "number", description: "Page number" }
              }
            }
          },
          {
            name: "get_organizational_form",
            description: "Get information about a specific organizational form",
            inputSchema: {
              type: "object",
              properties: {
                organisasjonskode: { type: "string", description: "Organizational form code (e.g., 'AS', 'ASA')" }
              },
              required: ["organisasjonskode"]
            }
          },
          {
            name: "get_municipalities",
            description: "Get all Norwegian municipalities",
            inputSchema: {
              type: "object",
              properties: {
                sort: { type: "string", description: "Sort order" },
                size: { type: "number", description: "Page size" },
                page: { type: "number", description: "Page number" }
              }
            }
          },
          {
            name: "get_municipality",
            description: "Get information about a specific Norwegian municipality",
            inputSchema: {
              type: "object",
              properties: {
                kommunenummer: { type: "string", description: "4-digit municipality number (e.g., '0301' for Oslo)" }
              },
              required: ["kommunenummer"]
            }
          },
          {
            name: "get_entity_updates",
            description: "Get updates on entities for maintaining a local copy of the registry",
            inputSchema: {
              type: "object",
              properties: {
                dato: { type: "string", description: "Show updates from this timestamp (ISO-8601)" },
                oppdateringsid: { type: "string", description: "Show updates from this update ID" },
                organisasjonsnummer: { type: "array", items: { type: "string" }, description: "Filter by organization numbers" },
                page: { type: "number", description: "Page number" },
                size: { type: "number", description: "Page size (default 20, max 10000)" },
                sort: { type: "string", description: "Sort by ID (ASC/DESC)" }
              }
            }
          },
          {
            name: "get_sub_entity_updates",
            description: "Get updates on sub-entities for maintaining a local copy of the registry",
            inputSchema: {
              type: "object",
              properties: {
                dato: { type: "string", description: "Show updates from this timestamp (ISO-8601)" },
                oppdateringsid: { type: "string", description: "Show updates from this update ID" },
                organisasjonsnummer: { type: "array", items: { type: "string" }, description: "Filter by organization numbers" },
                page: { type: "number", description: "Page number" },
                size: { type: "number", description: "Page size (default 20, max 10000)" },
                sort: { type: "string", description: "Sort by ID (ASC/DESC)" }
              }
            }
          },
          {
            name: "get_role_updates",
            description: "Get role updates for entities",
            inputSchema: {
              type: "object",
              properties: {
                afterTime: { type: "string", description: "Get events after this timestamp (ISO-8601)" },
                afterId: { type: "number", description: "Get events after this ID" },
                organisasjonsnummer: { type: "array", items: { type: "string" }, description: "Filter by organization numbers" },
                size: { type: "number", description: "Number of events to retrieve (default 100, max 10000)" }
              }
            }
          },
          {
            name: "search_voluntary_organizations",
            description: "Search voluntary organizations in the voluntary organization registry",
            inputSchema: {
              type: "object",
              properties: {
                searchAfter: { type: "string", description: "Search after this organization number for pagination" },
                size: { type: "number", description: "Maximum number of organizations (default 100)" },
                spraak: { type: "string", description: "Language for code descriptions (e.g., 'NOB')" }
              }
            }
          },
          {
            name: "get_voluntary_organization",
            description: "Get detailed information about a specific voluntary organization",
            inputSchema: {
              type: "object",
              properties: {
                organisasjonsnummer: { type: "string", description: "9-digit organization number" },
                spraak: { type: "string", description: "Language for code descriptions (e.g., 'NOB')" }
              },
              required: ["organisasjonsnummer"]
            }
          },
          {
            name: "get_icnpo_categories",
            description: "Get ICNPO (International Classification of Non-Profit Organisation) categories",
            inputSchema: {
              type: "object",
              properties: {
                spraak: { type: "string", description: "Language for descriptions (e.g., 'NOB')" }
              }
            }
          }
        ],
      };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a read operation ('Get information'), but doesn't mention any behavioral traits like error handling (e.g., what happens with invalid kommunenummer), response format, data freshness, or rate limits. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently communicates the core purpose. It's appropriately sized for a simple lookup tool and wastes no words. The structure is straightforward with no unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-parameter lookup tool with good schema coverage but no output schema, the description is minimally adequate. It states what the tool does but lacks context about the information returned, error conditions, or how it differs from sibling tools. Given the complexity is low, it's passable but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage with a clear parameter description, so the baseline is 3. The tool description doesn't add any parameter semantics beyond what's already in the schema - it mentions 'specific Norwegian municipality' which aligns with the parameter but provides no additional context about parameter usage or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get information') and resource ('specific Norwegian municipality'), making the purpose immediately understandable. It distinguishes from sibling 'get_municipalities' (plural) by specifying retrieval of a single municipality, though it doesn't explicitly contrast with other entity-related tools like 'get_entity' or 'search_entities'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_municipalities' (for multiple municipalities), 'get_entity' (for general entities), or 'search_entities' (for filtered searches). It simply states what the tool does without any contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/reidar80/BRREG-MCP'

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