Skip to main content
Glama

Find companies by activity

lookup_by_category
Read-onlyIdempotent

Find companies by what they do, not by name: a curated topic ('software', 'retail'), plain words ('dentists', a CAEN class title; see matched) or CAEN codes ('4321,4322'; 6201 also finds Rev.3 6210).

Instructions

Find companies by what they do, not by name: a curated topic ('software', 'retail'), plain words ('dentists', a CAEN class title; see matched) or CAEN codes ('4321,4322'; 6201 also finds Rev.3 6210). Narrow by county; qualify by revenue, headcount, VAT, main activity. active_only (default) drops dead and ANAF-inactive firms.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "topic": "<topic>"
    },
    "name": "lookup_by_category"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoOrder of the results: 'newest' registrations first (default), 'revenue' (latest filing's turnover, biggest first) or 'employees' (headcount, biggest first); firms without a filing come last.newest
topicYesWhat the firms do: a curated topic ('software', 'retail'), plain words for a trade ('dentists', 'stomatologie'), a CAEN class title in Romanian or English, or CAEN codes ('6201' or '4321,4322'). Case-, space- and diacritic-insensitive. A number that names another activity in each revision takes a suffix: '4781r3' (Rev.3) or '4781r2' (Rev.2).
countyNoOptional county to narrow to (diacritic-insensitive: 'bucuresti', 'cluj'; a county town such as 'Cluj-Napoca' or a Bucharest sector is read as its county); omit for nationwide. An unknown county is an error (unknown_county) with suggestions, not 0 firms.
fieldsNoOptional: keep only these company fields in each row, comma-separated (companyName,cui,county,risk; dotted paths such as risk.level work). Without it the full record is returned.
compactNoOptional: true keeps a short preset per row (name, CUI, county, city, legal form, risk level and what it did not check, phone, website, latest revenue and headcount, record url).
vat_payerNoOptional: true keeps VAT-registered firms only, false only non-VAT payers (ANAF data). Omit for both.
legal_formNoOptional legal form(s) to keep, comma-separated, case-insensitive: 'SRL', 'SA', 'PFA', 'II', or 'SRL,SA' (companies, no sole traders). Default: any form.
active_onlyNoDefault true: drop firms that are not a lead (struck off, dissolving, in liquidation, insolvent or bankrupt, activity suspended, or ANAF fiscally inactive). false returns every firm.
has_websiteNotrue keeps only firms with a website on file in the registry (default false).
max_resultsNoMaximum number of companies to return (1-100, default 10).
max_revenueNoOptional maximum net turnover in RON on the latest filing.
min_revenueNoOptional minimum net turnover in RON on the latest filing (FY2025, else FY2024). Firms without a filing never match a band.
max_employeesNoOptional maximum average headcount on the latest filing.
min_employeesNoOptional minimum average headcount on the latest filing.
main_activity_onlyNoDefault false: a firm matches when the code is ANY of its authorised activities (ONRC lists a dozen per firm, most never practised). true keeps only firms whose DECLARED main activity is one of the codes (ANAF main CAEN, else the CAEN on the latest filing): fewer, more relevant firms. The Leadgen app's lists use true by default.

Output Schema

NameRequiredDescriptionDefault
asOfNoWhat to cite: registry (ONRC snapshot date), financialYear (fiscal year of the figures), anaf (day of the ANAF data), snapshot, published, source.
sortNoThe order of results: newest, revenue or employees.
errorNoSet only when there is no answer (empty_query, invalid_cui, data_unavailable, plan_required ...); such a call is not counted.
labelNoHuman label of what was matched.
queryNoThe topic as given.
topicNoThe curated topic matched, if any.
totalNoRows returned in this answer (at most max_results), not the size of the match set: a full page (total == max_results) may have more; narrow the filters or raise max_results. The same as returned; the size of the whole list is matchTotal.
appUrlNoThe same list opened in the Leadgen app (CAEN codes, county, legal form, active and main-activity filters), to share with the user; null when the app cannot open it (more than 10 codes, a legal form it does not offer).
countyNoThe county filter, if any.
fieldsNoThe company fields kept when fields or compact trimmed the rows.
sourceNoData source: onrc (registry) or mfp (Ministry of Finance filings).
filtersNoThe filters applied (legalForm, activeOnly, revenue and headcount bands, vatPayer, mainActivityOnly ...).
matchedNoHow plain words were read: by, niche or class title, codes.
messageNoA sentence for the caller.
resultsNoThe company records, best first.
returnedNoRows in results. Every list answer carries it with this one meaning.
warningsNoNotes on how the request was read (a clamped limit, a widened CAEN code, an ignored field).
caenCodesNoThe CAEN codes searched, when given or derived as codes.
caenNamesNoThe CAEN codes as asked, named: [{code, title (Romanian), titleEn}].
truncatedNotrue when max_results was cut to the list cap (and the list is full).
candidatesNoWhen the words fit several activities (ambiguous_topic): the ones to choose from.
codesAddedNoCAEN Rev.2/Rev.3 counterparts added to the search.
matchTotalNoHow many firms the whole list holds with every filter (active_only on; null when off): exact, or estimated when matchTotalApproximate is true.
attributionNoThe credit line to keep when redistributing the data (CC BY 4.0).
warningDetailsNoThe warnings that have a machine-readable form (the CAEN Rev.2/Rev.3 notes): [{code, params, message}], message the same English line as in warnings; null when none.
availableTopicsNoThe curated topic ids, when the topic is unknown or ambiguous.
matchTotalMarginNoThe 99% margin of an estimated matchTotal.
availableTopicNamesNoEach curated topic id with its name, e.g. {"agriculture": "Agriculture & Food"}, next to availableTopics.
inactiveFilteredOutNoFirms removed by active_only (null when off).
matchTotalApproximateNotrue when matchTotal is estimated (matchTotalMargin: its 99% margin).
inactiveFilteredOutApproximateNotrue when that count is estimated.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.4
    • changedOutput schema / properties / results / items / description
      Previous value: -"A company record: companyName, cui, registrationCode, registrationDate (DD/MM/YYYY), legalForm, euid, address, county, city, website, phone, caenActivities [{code, activity (RO), activityEn}], directors, representatives [{name, role}], status [{code, name}], latestFinancials {year, revenue, netResult, employees; RON}, anaf {mainCaen, vatPayer, eFactura, inactive}, risk {level, label, reasons, isLead}, source, asOf, url (the firm's public record page to share with the user; null for sole traders and other natural persons), and score/match on name searches. With fields or compact, only the requested keys (compact keeps url)."New value: +"A company record: companyName, cui, registrationCode, registrationDate (DD/MM/YYYY), legalForm, euid, address (a sole trader's PFA/II/IF locality only in an answer listing several firms, with addressScope: locality), county, city, website, phone (+ phoneSource: ANAF, declared by the taxpayer), caenActivities [{code, activity (RO), activityEn}], directors, representatives [{name, role}], status [{code, name}], latestFinancials {year, revenue, netResult, employees; RON}, anaf {mainCaen, vatPayer, eFactura, inactive}, risk {level, label, reasons, isLead}, source, asOf, url (the firm's public record page to share with the user; null for sole traders and other natural persons), and score/match on name searches. With fields or compact, only the requested keys (compact keeps url)."
    • addedOutput schema / properties / returned
      Added value: +{
      +  "description": "Rows in results. Every list answer carries it with this one meaning.",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / total / description
      Previous value: -"Rows returned in this answer (at most max_results), not the size of the match set: a full page (total == max_results) may have more; narrow the filters or raise max_results."New value: +"Rows returned in this answer (at most max_results), not the size of the match set: a full page (total == max_results) may have more; narrow the filters or raise max_results. The same as returned; the size of the whole list is matchTotal."
    • addedOutput schema / properties / warningDetails
      Added value: +{
      +  "description": "The warnings that have a machine-readable form (the CAEN Rev.2/Rev.3 notes): [{code, params, message}], message the same English line as in warnings; null when none.",
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  2. Changed16 schema fields changedv0.1.3
    • changedInput schema / properties / compact / description
      Previous value: -"Optional: true keeps a short preset per row (name, CUI, county, city, legal form, risk level, phone, website, latest revenue and headcount)."New value: +"Optional: true keeps a short preset per row (name, CUI, county, city, legal form, risk level and what it did not check, phone, website, latest revenue and headcount, record url)."
    • changedInput schema / properties / county / description
      Previous value: -"Optional county name to narrow to (diacritic-insensitive: 'bucuresti', 'cluj'); omit for nationwide."New value: +"Optional county to narrow to (diacritic-insensitive: 'bucuresti', 'cluj'; a county town such as 'Cluj-Napoca' or a Bucharest sector is read as its county); omit for nationwide. An unknown county is an error (unknown_county) with suggestions, not 0 firms."
    • changedInput schema / properties / main_activity_only / description
      Previous value: -"true keeps firms whose declared main activity (ANAF main CAEN, else the CAEN on the latest filing) is one of the codes, instead of any authorised activity (default false)."New value: +"Default false: a firm matches when the code is ANY of its authorised activities (ONRC lists a dozen per firm, most never practised). true keeps only firms whose DECLARED main activity is one of the codes (ANAF main CAEN, else the CAEN on the latest filing): fewer, more relevant firms. The Leadgen app's lists use true by default."
    • addedInput schema / properties / sort
      Added value: +{
      +  "default": "newest",
      +  "description": "Order of the results: 'newest' registrations first (default), 'revenue' (latest filing's turnover, biggest first) or 'employees' (headcount, biggest first); firms without a filing come last.",
      +  "enum": [
      +    "newest",
      +    "revenue",
      +    "employees"
      +  ],
      +  "title": "Sort",
      +  "type": "string"
      +}
    • changedOutput schema / description
      Previous value: -"A lead list: firms in an activity, newest registration first."New value: +"A lead list: firms in an activity, newest registration first (or by turnover / headcount: sort)."
    • addedOutput schema / properties / appUrl
      Added value: +{
      +  "description": "The same list opened in the Leadgen app (CAEN codes, county, legal form, active and main-activity filters), to share with the user; null when the app cannot open it (more than 10 codes, a legal form it does not offer).",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / availableTopicNames
      Added value: +{
      +  "description": "Each curated topic id with its name, e.g. {\"agriculture\": \"Agriculture & Food\"}, next to availableTopics.",
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / availableTopics / description
      Previous value: -"The curated topics, when the topic is unknown."New value: +"The curated topic ids, when the topic is unknown or ambiguous."
    • addedOutput schema / properties / caenNames
      Added value: +{
      +  "description": "The CAEN codes as asked, named: [{code, title (Romanian), titleEn}].",
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / matchTotal
      Added value: +{
      +  "description": "How many firms the whole list holds with every filter (active_only on; null when off): exact, or estimated when matchTotalApproximate is true.",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / matchTotalApproximate
      Added value: +{
      +  "description": "true when matchTotal is estimated (matchTotalMargin: its 99% margin).",
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / matchTotalMargin
      Added value: +{
      +  "description": "The 99% margin of an estimated matchTotal.",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / results / items / description
      Previous value: -"A company record: companyName, cui, registrationCode, registrationDate (DD/MM/YYYY), legalForm, euid, address, county, city, website, phone, caenActivities [{code, activity}], directors, status [{code, name}], latestFinancials {year, revenue, netResult, employees; RON}, anaf {mainCaen, vatPayer, eFactura, inactive}, risk {level, label, reasons, isLead}, source, asOf, and score/match on name searches. With fields or compact, only the requested keys."New value: +"A company record: companyName, cui, registrationCode, registrationDate (DD/MM/YYYY), legalForm, euid, address, county, city, website, phone, caenActivities [{code, activity (RO), activityEn}], directors, representatives [{name, role}], status [{code, name}], latestFinancials {year, revenue, netResult, employees; RON}, anaf {mainCaen, vatPayer, eFactura, inactive}, risk {level, label, reasons, isLead}, source, asOf, url (the firm's public record page to share with the user; null for sole traders and other natural persons), and score/match on name searches. With fields or compact, only the requested keys (compact keeps url)."
    • addedOutput schema / properties / sort
      Added value: +{
      +  "description": "The order of results: newest, revenue or employees.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / total / description
      Previous value: -"Number of companies returned."New value: +"Rows returned in this answer (at most max_results), not the size of the match set: a full page (total == max_results) may have more; narrow the filters or raise max_results."
    • changedOutput schema / properties / truncated / description
      Previous value: -"true when more firms match than were returned."New value: +"true when max_results was cut to the list cap (and the list is full)."
  3. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnly, idempotent, not destructive, closed world), so the bar is lower; the description still adds non-obvious behaviour: active_only defaults to dropping dead and ANAF-inactive firms, and a single code ('6201') also surfaces firms under the matching code in other CAEN revisions. It does not discuss result caps or the matched field's semantics, keeping it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A tight three-clause sentence: what it matches on, how to narrow, and the default lifetime filter. Front-loaded with the key distinction ('not by name'), though the parenthetical about Rev.3/Rev.2 codes is dense and slightly interrupts the flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and full parameter documentation, the description only needs to frame the tool; it does that, covering input modes, narrowing, and the active_only default. It omits any note on the referenced 'matched' field's meaning and on result volume/sorting, which would help for a 15-parameter search tool.

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% across all 15 parameters, so the schema already documents topic forms, county handling, sort, field projection and the filter bands. The description only restates a subset (county, revenue, headcount, VAT, main activity) at a higher level, adding no syntax or edge-case detail beyond the schema. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Find companies') and immediately scopes it by modality: by activity rather than by name, with the three accepted input flavours (curated topic, plain trade words, CAEN codes). An agent can tell this apart from the name/domain/director lookups among the siblings without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage only: 'Narrow by county; qualify by revenue, headcount, VAT, main activity' signals how to constrain a search but never says when to reach for this tool over lookup_companies, lookup_business or match_companies, and names no exclusions. Adequate context, no routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.