dk_cvr_search
Search the Danish CVR registry for company details using name, CVR number, P-number, or phone. Retrieve address, industry, employees, owners, and status. Also supports Norwegian companies.
Instructions
Search the Danish CVR registry for a company by name, CVR number, P-number, or phone. Returns company details including address, industry, employees, owners, and status. Also supports Norwegian companies (country=no).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Company name, CVR number, P-number, or phone number to search for | |
| search_type | No | Specific search type. 'auto' (default) searches all fields. 'vat' = CVR number, 'name' = company name, 'produ' = P-number, 'phone' = phone number | |
| country | No | Country to search in. 'dk' = Denmark (default), 'no' = Norway |
Implementation Reference
- src/servers/danish-cvr.js:80-111 (handler)The tool "dk_cvr_search" is registered and implemented here. It takes a query, search_type, and country, processes the parameters, calls `fetchCVR`, and returns the formatted company data.
server.tool( "dk_cvr_search", "Search the Danish CVR registry for a company by name, CVR number, P-number, or phone. Returns company details including address, industry, employees, owners, and status. Also supports Norwegian companies (country=no).", { query: z.string().describe("Company name, CVR number, P-number, or phone number to search for"), search_type: z.enum(["auto", "vat", "name", "produ", "phone"]).optional() .describe("Specific search type. 'auto' (default) searches all fields. 'vat' = CVR number, 'name' = company name, 'produ' = P-number, 'phone' = phone number"), country: z.enum(["dk", "no"]).optional() .describe("Country to search in. 'dk' = Denmark (default), 'no' = Norway"), }, async ({ query, search_type, country }) => { const params = { country: country || "dk" }; if (search_type && search_type !== "auto") { params[search_type] = query; } else { // Auto-detect: if all digits and 8 chars, likely CVR number if (/^\d{8}$/.test(query)) { params.vat = query; } else { params.search = query; } } try { const data = await fetchCVR(params); return { content: [{ type: "text", text: formatCompany(data) }] }; } catch (err) { return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true }; } } );