no_search_companies
Search the Norwegian company registry (Enhetsregisteret) by name, industry, municipality, organization form, or employee count to find business information.
Instructions
Search Norwegian company registry (Enhetsregisteret) by name, industry, municipality, or organization form
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Company name to search for | |
| municipality | No | Municipality name (e.g., 'OSLO', 'BERGEN', 'STAVANGER') | |
| industry_code | No | NACE industry code (e.g., '62.010' for programming) | |
| org_form | No | Organization form code (e.g., 'AS', 'ASA', 'ENK', 'NUF') | |
| min_employees | No | Minimum number of employees | |
| active_only | No | Only show active companies (not bankrupt/dissolved) | |
| limit | No | Number of results (max 50) |
Implementation Reference
- The tool "no_search_companies" is defined here, which includes both the schema definition (inputs) and the handler logic that fetches data from the Enhetsregisteret API.
server.tool( "no_search_companies", "Search Norwegian company registry (Enhetsregisteret) by name, industry, municipality, or organization form", { query: z.string().optional().describe("Company name to search for"), municipality: z.string().optional().describe("Municipality name (e.g., 'OSLO', 'BERGEN', 'STAVANGER')"), industry_code: z.string().optional().describe("NACE industry code (e.g., '62.010' for programming)"), org_form: z.string().optional().describe("Organization form code (e.g., 'AS', 'ASA', 'ENK', 'NUF')"), min_employees: z.number().optional().describe("Minimum number of employees"), active_only: z.boolean().optional().default(true).describe("Only show active companies (not bankrupt/dissolved)"), limit: z.number().optional().default(10).describe("Number of results (max 50)"), }, async ({ query, municipality, industry_code, org_form, min_employees, active_only, limit }) => { const params = { size: Math.min(limit, 50) }; if (query) params.navn = query; if (municipality) params["kommunenummer"] = municipality; // We'll also support name if (industry_code) params["naeringskode1"] = industry_code; if (org_form) params["organisasjonsform"] = org_form; if (min_employees != null) params["fraAntallAnsatte"] = min_employees; if (active_only) { params["konkurs"] = false; params["underAvvikling"] = false; } // If municipality is a name, try search with it as part of query const data = await apiFetch("/enheter", params); const units = data._embedded?.enheter || []; if (units.length === 0) { return { content: [{ type: "text", text: "No companies found matching your criteria." }] }; } const total = data.page?.totalElements || units.length; const header = `Found ${total.toLocaleString()} companies (showing ${units.length}):\n`; const results = units.map((u, i) => `${i + 1}. ${formatCompanySummary(u)}`).join("\n\n"); return { content: [{ type: "text", text: header + "\n" + results }] }; } );