Skip to main content
Glama

Act counts by type, period and province

act_stats
Read-onlyIdempotent

Count BORME acts by act type, period (month, quarter or year) and province: how many companies and entries had mergers, spin-offs, capital increases or any other act type, newest period first.

Use it for trends ("mergers per quarter in Spain since 2020"). To read the acts themselves use search_events.

Returns JSON {grain, count, truncated, rows: [{period, act_type, province, companies, events}], data_through, built_from, built_to, note, plan_window}, plus hidden_by_plan when the plan left buckets out, and not_built (no rows, never zeros) when the range reaches years outside built_from..built_to. period is the bucket's first day by BORME publication date. companies counts distinct companies in that bucket: never add rows up. Province "*" is all of Spain; a community gives one row per province, not a total.

Read-only; one request per call. Needs the pro plan or higher: send your key in the X-API-Key header (https://bormeapi.com/account).

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": "act_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
grainNoThe length of each period, one of "month" (default), "quarter", "year", e.g. "quarter".month
limitNoMaximum rows, integer 1-5000, e.g. 200 (default 1000); truncated is true when more matched.
date_toNoOptional YYYY-MM-DD, e.g. 2025-12-31; periods starting on or before this day.
sectorsNoOptional list of two-digit CNAE-2009 divisions and/or "*" (all acts), e.g. ["62", "*"]: each row then names its sector, the company's sector on the act's publication date, attributed as by the division filter of search_events. A division row splits events into from_own (code printed in the act) and from_carried (code printed in an earlier act of the company), plus from_model with include_inferred=true, and gives companies per basis, which can overlap and must not be added up. The "*" row gives total = from_own + from_carried + unclassified, plus from_model with include_inferred=true (unclassified: acts without a sector and, without include_inferred=true, acts whose sector depends on the model). The answer's sectors block names division_axis "CNAE-2009" and policy_version. A year not yet computed returns not_built, never zeros. With provinces or by_province it needs grain "year".
act_typesNoOptional list of act type enums to count, e.g. ["MERGER_BY_ABSORPTION", "TOTAL_SPIN_OFF"]; omit for every act type. Full list: list_act_types.
date_fromNoOptional YYYY-MM-DD, e.g. 2024-01-01; the period holding this day is the first one. Data starts on 2009-01-02.
provincesNoOptional list of BORME province names, accent- and case-insensitive, e.g. ["MADRID", "BARCELONA"]; an autonomous community gives one row per province, e.g. ["Cataluña"]. Omit for the all-provinces rows (province "*").
by_provinceNoWithout provinces: true gives one row per province instead of the all-provinces rows, e.g. true (default false).
include_inferredNoOptional, default false, e.g. false. true requires sectors and also counts sectors that depend on a language-model decision (from_model, acts published from 2024-11-05), and the sectors block includes model, prompt and min_confidence. Without include_inferred=true, those acts are left out of the division rows and counted in unclassified in the "*" row. While those sectors are not offered, true is refused with an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / include_inferred
      Added value: +{
      +  "description": "Optional, default false, e.g. false. true requires sectors and also counts sectors that depend on a language-model decision (from_model, acts published from 2024-11-05), and the sectors block includes model, prompt and min_confidence. Without include_inferred=true, those acts are left out of the division rows and counted in unclassified in the \"*\" row. While those sectors are not offered, true is refused with an error.",
      +  "title": "Include Inferred",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / sectors
      Added value: +{
      +  "description": "Optional list of two-digit CNAE-2009 divisions and/or \"*\" (all acts), e.g. [\"62\", \"*\"]: each row then names its sector, the company's sector on the act's publication date, attributed as by the division filter of search_events. A division row splits events into from_own (code printed in the act) and from_carried (code printed in an earlier act of the company), plus from_model with include_inferred=true, and gives companies per basis, which can overlap and must not be added up. The \"*\" row gives total = from_own + from_carried + unclassified, plus from_model with include_inferred=true (unclassified: acts without a sector and, without include_inferred=true, acts whose sector depends on the model). The answer's sectors block names division_axis \"CNAE-2009\" and policy_version. A year not yet computed returns not_built, never zeros. With provinces or by_province it needs grain \"year\".",
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Sectors",
      +  "type": "array"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover read-only, idempotent and non-destructive, but the description goes well past that: authentication and plan requirement, one-request-per-call, plan-based bucket hiding (hidden_by_plan), not_built instead of zeros for out-of-range years, and the non-additivity rule for companies. These are exactly the behavioral traps an agent would otherwise fall into.

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?

Purpose and routing are front-loaded in the first two sentences, and the return-shape block is dense but earns its place given there is no output schema. Some clauses, such as the note field and plan_window enumeration, are terse enough to be a little cryptic, but nothing is clearly padding.

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 9-parameter, no-output-schema analytics tool, the description supplies the return object shape, key field meanings, aggregation caveats, and empty-versus-zero semantics. There is essentially no call-correctness information an agent would have to guess at.

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 schema already documents each parameter, making 3 the baseline. The description still adds real meaning beyond it: period is the bucket's first day by BORME publication date (which governs date_from/date_to behavior) and the province "*" versus community distinction. It does not add syntax detail for limit or sectors beyond what the schema carries.

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?

Opens with a specific verb and resource ("Count BORME acts") plus the three dimensions counted (act type, period, province), then explicitly directs act-level reads to search_events. An agent can distinguish it from search_events and list_act_types 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 Guidelines5/5

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

Gives a concrete use case ("mergers per quarter in Spain since 2020") and names the alternative tool and the condition that selects it ("To read the acts themselves use search_events"). It also states the prerequisite up front: pro plan or higher with an X-API-Key header, one request per call.

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.