Skip to main content
Glama
reidar80

Norwegian Business Registry MCP Server

by reidar80

get_role_updates

Retrieve recent role changes and updates for Norwegian business entities, filtering by organization numbers, time, or event ID to monitor corporate governance changes.

Instructions

Get role updates for entities

Input Schema

NameRequiredDescriptionDefault
afterIdNoGet events after this ID
afterTimeNoGet events after this timestamp (ISO-8601)
organisasjonsnummerNoFilter by organization numbers
sizeNoNumber of events to retrieve (default 100, max 10000)

Input Schema (JSON Schema)

{ "properties": { "afterId": { "description": "Get events after this ID", "type": "number" }, "afterTime": { "description": "Get events after this timestamp (ISO-8601)", "type": "string" }, "organisasjonsnummer": { "description": "Filter by organization numbers", "items": { "type": "string" }, "type": "array" }, "size": { "description": "Number of events to retrieve (default 100, max 10000)", "type": "number" } }, "type": "object" }

Implementation Reference

  • Core implementation of get_role_updates tool: makes an HTTP request to the BRREG API endpoint for role updates using the makeRequest helper.
    async getRoleUpdates(params: { afterTime?: string; afterId?: number; organisasjonsnummer?: string[]; size?: number; } = {}) { return this.makeRequest('/enhetsregisteret/api/oppdateringer/roller', params); }
  • MCP server dispatch handler for get_role_updates: calls BrregApiClient.getRoleUpdates and returns JSON-formatted response.
    case "get_role_updates": const roleUpdates = await apiClient.getRoleUpdates(request.params.arguments as any); return { content: [ { type: "text", text: JSON.stringify(roleUpdates, null, 2), }, ], };
  • Registration of the get_role_updates tool in the ListTools handler, including name, description, and input schema.
    { 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)" } } } },
  • TypeScript type definition for input parameters matching the tool schema.
    async getRoleUpdates(params: { afterTime?: string; afterId?: number; organisasjonsnummer?: string[]; size?: number; } = {}) { return this.makeRequest('/enhetsregisteret/api/oppdateringer/roller', params); }
  • Helper method used by getRoleUpdates to construct URL query params and fetch from BRREG API, handling errors.
    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