Skip to main content
Glama

count_legal_entities

Count legal entities in Sweden's business register by county, municipality, industry, or employee-size filters without listing individual records.

Instructions

Count legal entities in the register, with the same filters as the search. Cheaper than listing them.

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_legal_entities"
  }
}

Input Schema

NameRequiredDescriptionDefault
lanNoCounty code, two digits, for example 04 for Södermanland.
kommunNoMunicipality code, four digits, for example 0486 for Strängnäs.
naringsgrenNoIndustry code (SNI), for example 41200 for building construction.
anstalldaklassNoSize class code for the number of employees.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. 'Count' implies a read-only aggregate and the cost note hints at performance characteristics, but it doesn't state permissions, rate limits, or confirm the return value is a number.

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?

A single compact sentence with the resource and the differentiator front-loaded. Nothing 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 zero-required-parameter count tool with fully documented schema and no output schema, this is close to sufficient. The only mild gap is not spelling out that the result is a numeric total.

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 each filter (lan, kommun, naringsgren, anstalldaklass) is already documented with examples. The description only adds the cross-reference that these filters mirror the search tool; it adds no new syntax or semantics.

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

Purpose4/5

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

States a specific verb (count) and resource (legal entities in the register), plus a scope note tying filters to the search. It distinguishes itself from search_legal_entities implicitly via 'cheaper than listing them,' though it never names the sibling outright.

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?

'Cheaper than listing them' gives a clear when-to-use condition: choose this over the search/list tool when only a total is needed. It stops short of naming search_legal_entities or stating explicit exclusions, so it lands at 4 rather than 5.

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