Skip to main content
Glama

count_companies

Read-only

Count French companies matching filters such as NAF/APE code, postcode, department, municipality, or activity section, optionally including closed businesses; returns the total matching company count.

Instructions

How many French companies match filters (Recherche d'entreprises API). Use it for "how many" questions.

Returns total_results, the number of matching companies, and the filters applied.

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
naf_codeNoNAF/APE code(s) of the main activity, comma-separated, in the form 00.00X (optional).
postcodeNo5-digit postcode(s), comma-separated (optional).
departmentNoDepartment code (optional).
municipalityNoMunicipality name as written in the question (optional). Counts companies with at least one establishment there.
include_closedNoInclude closed companies.
activity_sectionNoSection letter(s) of the main activity, A to U (optional), e.g. I = accommodation and food.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true. The description adds that the result is total_results plus the filters applied, but it does not disclose rate limits, auth needs, or behavior around closed companies beyond what the schema provides.

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?

The description is front-loaded and brief: purpose, usage cue, and return summary in a few short sentences. No sentence is redundant or wasted.

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 simple read-only count tool with an output schema and fully described parameters, the description covers purpose, usage cue, and return shape adequately. The main minor gap is the lack of explicit alternative routing to search_companies.

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%, so all six filter parameters are already documented in the schema. The description only refers generically to 'filters' and adds no syntax or format meaning beyond the schema.

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: counting French companies matching filters. The phrase 'Use it for "how many" questions' clearly distinguishes this from listing/searching companies.

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?

Explicitly gives the selection condition: use for "how many" questions. It does not name search_companies as the alternative or state when not to use this tool, so it falls short of full when/when-not guidance.

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