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 registry number.
nipNoNIP tax number.
pkdNoPrimary PKD code prefix, e.g. '46.90.Z' or '46'.
cityNoCity name — KRS uses uppercase.
nameNoCompany name fragment (case-insensitive). Matches display name and full KRS name; legal-form suffixes like 'sp. z o.o.' are ignored.
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. Changed2 schema fields changed
    • addedInput schema / properties / registration_date_max
      Added value: +{
      +  "description": "Latest KRS registration date, YYYY-MM-DD (inclusive).",
      +  "type": "string"
      +}
    • addedInput schema / properties / registration_date_min
      Added value: +{
      +  "description": "Earliest KRS registration date, YYYY-MM-DD (inclusive). For newly registered companies use today's date for both registration_date_min and registration_date_max.",
      +  "type": "string"
      +}
  5. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, so the description's job is lighter. It still adds real behavioral context the annotations cannot: the result is a scalar not a list, JDG is excluded from the count, and sparse/zero counts in JDG-dominated PKDs carry a `hint` — the kind of caveat that prevents misreading a low count as a data gap.

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?

Four short sentences, front-loaded with what is counted and what is returned, then the exclusion and the caveat. Nothing is wasted, though the parenthetical about Compabase/RODO is internal context an agent may not need.

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, zero-required aggregation tool with no output schema, the description correctly states the return type is a single number (so the missing output schema is not a problem) and flags the `hint` field. Only an explicit pointer to the listing alternatives is missing.

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?

The 34 parameters are already fully documented in the schema (100% coverage), including per-filter guidance like the year-parameter restriction. The description adds no syntax or interaction detail for these filters, so it sits at the baseline where the schema does the work.

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 pins the return shape ('Returns a single number — no company list'), which distinguishes it from the listing/export siblings without needing to open their schemas.

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 a clear scope boundary — JDG is not counted here, CEIDG lives in Compabase and is RODO-gated — so an agent knows why a JDG-heavy query may undercount. It stops short of explicitly routing the agent to search_companies/export_companies when an actual company list is wanted, so it is not a full when/when-not/alternatives statement.

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.