Skip to main content
Glama

Anuário

Count companies

count_companies
Read-onlyIdempotent

How many companies the register copy holds for an activity code (CAE Rev.4, 2 to 5 digits: a shorter code counts everything below it), a concelho and/or a founding year or month. Returns counts by status with the date of the copy and the definitions used. Use this, not list_companies, to size a sector or compare places.

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
caeNoCAE Rev.4 code or the start of one, e.g. "56" or "56111" (main activity only)
foundedNoFounding year YYYY or month YYYY-MM
municipalityNoConcelho name, e.g. "Braga"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, closed-world and non-destructive, so safety is covered. The description adds genuinely new behavior: counts are broken out by status, the copy's date and the definitions used are returned, and shorter CAE prefixes roll up subordinate codes. It stops short of describing empty-result or all-filters-omitted behavior.

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?

Two sentences, front-loaded with what is counted and how, then the return content, then the routing hint. No redundant restatement of the title or schema.

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

Completeness5/5

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

For a three-optional-parameter count tool with no output schema, the description supplies the return shape (counts by status, copy date, definitions) and the CAE roll-up rule, and annotations cover the safety profile. Nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description earns more by explaining the hierarchical prefix behavior for the CAE parameter and the 'and/or' combinability of the three optional filters, which the schema does not state.

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 companies) plus the exact filter set: CAE Rev.4 code, concelho, founding year or month. The parenthetical 'a shorter code counts everything below it' pins down the counting semantics, and the closing clause explicitly separates it from list_companies.

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

Usage Guidelines5/5

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

Gives an explicit when-to-use ('to size a sector or compare places') and names the alternative it replaces ('Use this, not list_companies'). An agent does not need to infer the choice from sibling names alone.

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.

Resources