Skip to main content
Glama
reidar80

Norwegian Business Registry MCP Server

by reidar80

get_municipalities

Retrieve comprehensive lists of Norwegian municipalities with pagination and sorting options for business registry queries.

Instructions

Get all Norwegian municipalities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort order
sizeNoPage size
pageNoPage number

Implementation Reference

  • MCP tool handler for 'get_municipalities': calls apiClient.getMunicipalities() and returns the result as a formatted JSON text response.
    case "get_municipalities":
      const municipalities = await apiClient.getMunicipalities();
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(municipalities, null, 2),
          },
        ],
      };
  • Tool registration including name, description, and input schema definition (optional pagination parameters, though not used in handler).
    {
      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" }
        }
      }
    },
  • BrregApiClient helper method that fetches the list of municipalities from the BRREG API endpoint.
    async getMunicipalities() {
      return this.makeRequest('/enhetsregisteret/api/kommuner');
    }
  • Core utility method in BrregApiClient for making HTTP requests to BRREG API endpoints, handling params, errors, and JSON parsing.
    private async makeRequest(endpoint: string, params?: Record<string, any>): Promise<any> {
      const url = new URL(`${BASE_URL}${endpoint}`);
      
      if (params) {
        Object.entries(params).forEach(([key, value]) => {
          if (value !== undefined && value !== null) {
            if (Array.isArray(value)) {
              url.searchParams.set(key, value.join(','));
            } else {
              url.searchParams.set(key, String(value));
            }
          }
        });
      }
    
      const response = await fetch(url.toString(), {
        headers: {
          'Accept': 'application/json',
        },
      });
    
      if (!response.ok) {
        if (response.status === 404) {
          throw new McpError(ErrorCode.InvalidRequest, `Resource not found: ${endpoint}`);
        }
        throw new McpError(ErrorCode.InternalError, `API request failed: ${response.status} ${response.statusText}`);
      }
    
      return response.json();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets' data, implying a read-only operation, but lacks details on permissions, rate limits, pagination behavior (implied by parameters but not explained), or response format. This is inadequate for a tool with parameters and no output schema.

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, efficient sentence with zero wasted words. It's front-loaded with the core purpose, making it easy to scan and understand quickly.

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

Completeness2/5

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

Given the tool has parameters (sort, size, page) and no output schema, the description is incomplete. It doesn't address how the tool behaves with pagination, what data is returned, or error conditions. For a list-retrieval tool with parameters, more context is needed to guide effective use.

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 input schema has 100% description coverage, providing basic parameter definitions. The description adds no additional meaning beyond implying retrieval of municipalities, but it doesn't explain how parameters like 'sort' or 'page' affect the results. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Get') and resource ('all Norwegian municipalities'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_municipality' (singular) or 'search_entities' that might overlap in functionality, missing explicit distinction.

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. With siblings like 'get_municipality' (likely for a single municipality) and 'search_entities' (potentially broader searches), there's no indication of context, exclusions, or prerequisites for selecting this tool.

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