Skip to main content
Glama

Count Polish Companies

count_companies
Read-onlyIdempotent

Count KRS companies matching given filters. Returns a single number — no company list. Does not count JDG in this tool (full CEIDG is in Compabase; listing is RODO-gated). Sparse or zero counts in JDG-dominated PKDs include a hint.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "count_companies"
  }
}

Input Schema

NameRequiredDescriptionDefault
krsNoKRS number of the company in the Polish National Court Register (10 digits).
nipNoPolish company tax number (NIP) of the business, 10 digits.
pkdNoPrimary PKD code prefix, e.g. '46.90.Z' or '46'.
cityNoCity name — KRS uses uppercase.
nameNoCompany name, used when the KRS or NIP is not known.
yearNoFilter to companies whose latest financial_period_to falls within this calendar year. Use only for sector/ranking browse — omit when looking up a company by name, KRS, or NIP.
naicsNoDetailed industry: NAICS 6-digit codes, comma-separated (any of them), e.g. '541511,541512'. AI classification of what the company actually does.
nicheNoDetailed industry in words (Polish, English or German), matched against the company's niche, e.g. 'opakowania', 'software house', 'catering', 'Verpackungen'.
countyNoCounty / powiat (lowercase).
regionNoVoivodeship (lowercase).
all_pkdNoMatch any PKD code in the company's activity list (not just primary).
serviceNoService the company offers (Compabase services dictionary, from company websites): service name in Polish/English/German, e.g. 'księgowość', 'heat pumps', or slugs from compabase.com/services, comma-separated (any of them).
has_emailNotrue = only companies with email on record. Omit otherwise.
is_activeNotrue = active only, false = closed only. Omit for all.
ebitda_maxNoMaximum EBITDA in PLN.
ebitda_minNoMinimum EBITDA in PLN.
legal_formNoLegal form fragment.
profit_maxNoMaximum net profit in PLN.
profit_minNoMinimum net profit in PLN.
capital_maxNoMaximum share capital in PLN.
capital_minNoMinimum share capital in PLN.
has_websiteNotrue = only companies with website on record. Omit otherwise.
revenue_maxNoMaximum total revenue in PLN.
revenue_minNoMinimum total revenue in PLN.
family_businessNotrue = family business (people with the same surname hold ≥50%).
total_assets_maxNoMaximum total assets in PLN.
total_assets_minNoMinimum total assets in PLN.
estimated_value_maxNoMaximum Ohlson estimated equity value in PLN.
estimated_value_minNoMinimum Ohlson estimated equity value in PLN.
ownership_structureNoOwnership: pl_independent = Polish company controlled by individuals; pl_group = part of a Polish group (a Polish company holds ≥50%); foreign_group = foreign shareholders ≥50% or foreign parent (GLEIF / CRBR).
profit_operating_maxNoMaximum operating profit in PLN.
profit_operating_minNoMinimum operating profit in PLN.
registration_date_maxNoLatest KRS registration date, YYYY-MM-DD (inclusive).
registration_date_minNoEarliest KRS registration date, YYYY-MM-DD (inclusive). For newly registered companies use today's date for both registration_date_min and registration_date_max.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / niche / description
      Previous value: -"Detailed industry in words (Polish), matched against the company's niche, e.g. 'opakowania', 'software house', 'catering'."New value: +"Detailed industry in words (Polish, English or German), matched against the company's niche, e.g. 'opakowania', 'software house', 'catering', 'Verpackungen'."
  2. Changed1 schema field changed
    • addedInput schema / properties / service
      Added value: +{
      +  "description": "Service the company offers (Compabase services dictionary, from company websites): service name in Polish/English/German, e.g. 'księgowość', 'heat pumps', or slugs from compabase.com/services, comma-separated (any of them).",
      +  "type": "string"
      +}
  3. Changed4 schema fields changed
    • addedInput schema / properties / family_business
      Added value: +{
      +  "description": "true = family business (people with the same surname hold ≥50%).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / naics
      Added value: +{
      +  "description": "Detailed industry: NAICS 6-digit codes, comma-separated (any of them), e.g. '541511,541512'. AI classification of what the company actually does.",
      +  "type": "string"
      +}
    • addedInput schema / properties / niche
      Added value: +{
      +  "description": "Detailed industry in words (Polish), matched against the company's niche, e.g. 'opakowania', 'software house', 'catering'.",
      +  "type": "string"
      +}
    • addedInput schema / properties / ownership_structure
      Added value: +{
      +  "description": "Ownership: pl_independent = Polish company controlled by individuals; pl_group = part of a Polish group (a Polish company holds ≥50%); foreign_group = foreign shareholders ≥50% or foreign parent (GLEIF / CRBR).",
      +  "enum": [
      +    "pl_independent",
      +    "pl_group",
      +    "foreign_group"
      +  ],
      +  "type": "string"
      +}
  4. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds genuinely useful behavior beyond that: the single-number return, the JDG exclusion, and the fact that sparse or zero counts in JDG-dominated PKDs carry a `hint`. That context earns above baseline, though it does not cover rate limits, permissions, or cost of broad filters.

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

Conciseness5/5

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

Three short sentences, front-loaded with the core verb and output shape, then the JDG caveat, then the hint behavior. No filler and nothing repeated from annotations.

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?

For a 34-parameter filter tool with no output schema, the description correctly sets expectations about the scalar return value and the hint field. What remains unsaid is how to interpret a zero count (no matches vs. excluded JDG-only matches) in cases without a hint, a minor gap.

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% with 34 fully documented parameters, so the schema carries parameter meaning. The description adds no filter syntax or interaction guidance (e.g. how krs/nip/name combine), so 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 ("Count KRS companies matching given filters") and immediately clarifies the output shape ("Returns a single number — no company list"), which is the key distinction from the sibling search_companies. An agent can pick between counting and listing without opening a schema.

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

Usage Guidelines4/5

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

Gives clear scope boundaries: it does not count JDG, CEIDG lives in Compabase, and listing is RODO-gated. The when-to-use-vs-search_companies routing is implied by "no company list" rather than stated as an explicit alternative, so it stops short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.