Skip to main content
Glama
robobobby
by robobobby

no_search_subunits

Find branches, offices, and departments of Norwegian companies by parent organization number, name search, or municipality. Retrieve up to 50 results per query.

Instructions

Search sub-units (underenheter) - branches, offices, departments of Norwegian companies

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_org_numberNoParent company org number to find its sub-units
queryNoName search
municipalityNoMunicipality name
limitNoNumber of results (max 50)

Implementation Reference

  • The handler for the no_search_subunits tool, which queries the /underenheter API and formats the results.
      async ({ parent_org_number, query, municipality, limit }) => {
        const params = { size: Math.min(limit, 50) };
        if (parent_org_number) params["overordnetEnhet"] = parent_org_number.replace(/\s/g, "");
        if (query) params.navn = query;
        if (municipality) params["kommunenummer"] = municipality;
    
        const data = await apiFetch("/underenheter", params);
        const units = data._embedded?.underenheter || [];
    
        if (units.length === 0) {
          return { content: [{ type: "text", text: "No sub-units found." }] };
        }
    
        const total = data.page?.totalElements || units.length;
        const header = `Found ${total.toLocaleString()} sub-units (showing ${units.length}):\n`;
        const results = units.map((u, i) => {
          const lines = [
            `${i + 1}. **${u.navn}**`,
            `   Org.nr: ${u.organisasjonsnummer}`,
            `   Parent: ${u.overordnetEnhet || "N/A"}`,
          ];
          if (u.naeringskode1?.beskrivelse) lines.push(`   Industry: ${u.naeringskode1.beskrivelse}`);
          if (u.antallAnsatte != null) lines.push(`   Employees: ${u.antallAnsatte}`);
          lines.push(`   Address: ${formatAddress(u.beliggenhetsadresse)}`);
          return lines.join("\n");
        }).join("\n\n");
    
        return { content: [{ type: "text", text: header + "\n" + results }] };
      }
    );
  • Tool registration for no_search_subunits with Zod schema for input validation.
    server.tool(
      "no_search_subunits",
      "Search sub-units (underenheter) - branches, offices, departments of Norwegian companies",
      {
        parent_org_number: z.string().optional().describe("Parent company org number to find its sub-units"),
        query: z.string().optional().describe("Name search"),
        municipality: z.string().optional().describe("Municipality name"),
        limit: z.number().optional().default(10).describe("Number of results (max 50)"),
      },

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