get_municipality
Retrieve detailed information about Norwegian municipalities using their 4-digit municipality number to access governance and administrative data from the Norwegian Business Registry.
Instructions
Get information about a specific Norwegian municipality
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kommunenummer | Yes | 4-digit municipality number (e.g., '0301' for Oslo) |
Input Schema (JSON Schema)
{
"properties": {
"kommunenummer": {
"description": "4-digit municipality number (e.g., '0301' for Oslo)",
"type": "string"
}
},
"required": [
"kommunenummer"
],
"type": "object"
}
Implementation Reference
- src/brreg-mcp-server.ts:494-504 (handler)Executes the get_municipality tool: extracts the municipality number from arguments, fetches data via apiClient.getMunicipality, and returns the JSON-formatted result as tool 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), }, ], };
- src/brreg-mcp-server.ts:307-317 (schema)Tool registration and schema definition: specifies 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"] } },
- src/brreg-mcp-server.ts:111-113 (helper)BrregApiClient method that performs the HTTP request to BRREG API endpoint for the specific municipality using the provided number.async getMunicipality(municipalityNumber: string) { return this.makeRequest(`/enhetsregisteret/api/kommuner/${municipalityNumber}`); }