Skip to main content
Glama
reidar80

Norwegian Business Registry MCP Server

by reidar80

get_entity_updates

Retrieve recent changes to Norwegian business entities to maintain an updated local copy of the registry. Specify timestamps, update IDs, or organization numbers to filter results.

Instructions

Get updates on entities for maintaining a local copy of the registry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datoNoShow updates from this timestamp (ISO-8601)
oppdateringsidNoShow updates from this update ID
organisasjonsnummerNoFilter by organization numbers
pageNoPage number
sizeNoPage size (default 20, max 10000)
sortNoSort by ID (ASC/DESC)

Implementation Reference

  • Core implementation of the get_entity_updates tool in BrregApiClient, which constructs the API URL and fetches entity updates from the BRREG endpoint '/enhetsregisteret/api/oppdateringer/enheter'.
    async getEntityUpdates(params: {
      dato?: string;
      oppdateringsid?: string;
      organisasjonsnummer?: string[];
      page?: number;
      size?: number;
      sort?: string;
    } = {}) {
      return this.makeRequest('/enhetsregisteret/api/oppdateringer/enheter', params);
    }
  • MCP server dispatch handler for the get_entity_updates tool call, which invokes the apiClient method with input arguments and returns the result as formatted JSON text content.
    case "get_entity_updates":
      const entityUpdates = await apiClient.getEntityUpdates(request.params.arguments as any);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(entityUpdates, null, 2),
          },
        ],
      };
  • Registration of the get_entity_updates tool in the MCP server's listTools response, specifying name, description, and input schema.
    {
      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)" }
        }
      }
    },
  • Input schema definition for the get_entity_updates tool, validating parameters passed to the handler.
      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)" }
      }
    }
  • Helper method used by getEntityUpdates to construct the query URL, make the fetch request to BRREG API, handle errors, and parse JSON response.
    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?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'updates' and 'maintaining a local copy', implying incremental/changed data retrieval, but doesn't disclose pagination behavior (beyond schema), rate limits, authentication needs, error conditions, or what constitutes an 'update'. The schema covers parameters but not operational behavior.

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 that front-loads the core action ('Get updates on entities') and purpose ('for maintaining a local copy of the registry'). There is no wasted verbiage or redundant information.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'updates' include (e.g., created/modified/deleted entities), return format, error handling, or how it interacts with siblings. The purpose is clear but operational context is lacking.

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?

Schema description coverage is 100%, so parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond implying temporal filtering ('updates') and registry context. It doesn't explain relationships between parameters like dato and oppdateringsid, or provide usage examples.

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 updates' and the resource 'entities', and specifies the purpose 'for maintaining a local copy of the registry'. It distinguishes from siblings like get_entity (which likely gets single entities) and get_entity_roles (which gets roles), but doesn't explicitly differentiate from get_sub_entity_updates or get_role_updates.

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_entity, get_sub_entity_updates, or search_entities. It mentions the purpose of maintaining a local registry copy, but doesn't specify prerequisites, timing, or exclusion criteria relative to other tools.

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