Skip to main content
Glama
robobobby
by robobobby

no_company_roles

Retrieve board members, CEO, auditor, and other roles for Norwegian companies using their 9-digit organization number.

Instructions

Get roles (board members, CEO, auditor, etc.) for a Norwegian company

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
org_numberYes9-digit organization number

Implementation Reference

  • The implementation and registration of the 'no_company_roles' tool, which fetches roles from the Norwegian Brønnøysund Register Centre API.
    server.tool(
      "no_company_roles",
      "Get roles (board members, CEO, auditor, etc.) for a Norwegian company",
      {
        org_number: z.string().describe("9-digit organization number"),
      },
      async ({ org_number }) => {
        const clean = org_number.replace(/\s/g, "");
        const res = await fetch(`https://data.brreg.no/enhetsregisteret/api/enheter/${clean}/roller`, {
          headers: { Accept: "application/json", "User-Agent": USER_AGENT },
        });
    
        if (!res.ok) {
          if (res.status === 404) {
            return { content: [{ type: "text", text: `No roles found for org number ${clean}.` }] };
          }
          throw new Error(`API error (${res.status})`);
        }
    
        const data = await res.json();
        const groups = data.rollegrupper || [];
    
        if (groups.length === 0) {
          return { content: [{ type: "text", text: "No role information available for this company." }] };
        }
    
        const lines = [`**Roles for ${clean}:**\n`];
        for (const group of groups) {
          lines.push(`## ${group.type?.beskrivelse || "Unknown"}`);
          for (const role of group.roller || []) {
            const person = role.person;
            const org = role.enhet;
            if (person) {
              const name = [person.fornavn, person.mellomnavn, person.etternavn].filter(Boolean).join(" ");
              lines.push(`- ${name} (${role.type?.beskrivelse || "?"})${role.fratraadt ? " [resigned]" : ""}`);
            } else if (org) {
              lines.push(`- ${org.organisasjonsnummer} ${org.organisasjonsform?.kode || ""} (${role.type?.beskrivelse || "?"})`);
            }
          }
          lines.push("");
        }
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      }
    );

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/robobobby/mcp-nordic'

If you have feedback or need assistance with the MCP directory API, please join our Discord server