Skip to main content
Glama
reidar80

Norwegian Business Registry MCP Server

by reidar80

get_entity

Retrieve detailed information about Norwegian businesses using their 9-digit organization number, including company data, board members, and corporate structure.

Instructions

Get detailed information about a specific Norwegian business entity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organisasjonsnummerYes9-digit organization number

Implementation Reference

  • MCP tool handler for 'get_entity': extracts organisasjonsnummer from arguments, calls apiClient.getEntity(), formats response as JSON text content.
    case "get_entity": const { organisasjonsnummer } = request.params.arguments as { organisasjonsnummer: string }; const entity = await apiClient.getEntity(organisasjonsnummer); return { content: [ { type: "text", text: JSON.stringify(entity, null, 2), }, ], };
  • BrregApiClient method implementing the core logic: constructs BRREG API URL for specific entity and fetches data via makeRequest.
    async getEntity(orgNumber: string) { return this.makeRequest(`/enhetsregisteret/api/enheter/${orgNumber}`); }
  • Registers the 'get_entity' tool in the MCP server's list of tools, including name, description, and input schema.
    { 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"] } },
  • Input schema defining the required 'organisasjonsnummer' parameter (string, 9-digit org number) for the get_entity tool.
    inputSchema: { type: "object", properties: { organisasjonsnummer: { type: "string", description: "9-digit organization number" } }, required: ["organisasjonsnummer"] }
  • Shared helper method in BrregApiClient for making HTTP requests to BRREG API, handling query params, fetch, error handling, 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(); }

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