Skip to main content
Glama

Analytics Legends — SAP AI & Analytics MCP Server

Count the firm directory by country, region, kind, module or SAP signal

count_firms_by
Read-only

Count the firm directory by country, region, kind, module or sap_signal_band, with search_firms' filters, instead of paging search_firms to tally. Rows: value, n; the tail folds into '(other)'. Public.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "by": "<by>"
    },
    "name": "count_firms_by"
  }
}

Input Schema

NameRequiredDescriptionDefault
byYesWhich facet to count on.
kindNoOrganisation kind (list_firm_kinds).
queryNoAll words must match.
moduleNoSAP module code; list: count_firms_by by=module.
regionNo
countryNoISO alpha-2.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / properties
      Removed value: -{
      -  "rows": {
      -    "type": "array"
      -  }
      -}
  2. Changed15 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / by / description
      Previous value: -"Which facet to count on. Required — there is no default worth guessing."New value: +"Which facet to count on."
    • changedInput schema / properties / country / description
      Previous value: -"ISO-3166-1 alpha-2 country code, e.g. DE, FR, CH."New value: +"ISO alpha-2."
    • removedInput schema / properties / country / pattern
      Removed value: -"^[A-Za-z]{2}$"
    • changedInput schema / properties / kind / description
      Previous value: -"Restrict to one organisation kind before counting, same vocabulary as search_firms. Combining it with `by:\"kind\"` is legal and returns that single bucket."New value: +"Organisation kind (list_firm_kinds)."
    • changedInput schema / properties / module / description
      Previous value: -"Restrict to organisations with a DECLARED link to one SAP module code before counting, same vocabulary as search_firms' `module`. Combining it with `by:\"module\"` is legal and returns that single bucket (plus the null bucket)."New value: +"SAP module code; list: count_firms_by by=module."
    • changedInput schema / properties / query / description
      Previous value: -"Free-text filter, case-insensitive. EVERY word must appear in the record (substring per word, any order), so a natural-language phrase narrows the answer instead of having to match verbatim."New value: +"All words must match."
    • removedInput schema / properties / query / maxLength
      Removed value: -200
    • removedInput schema / properties / region / description
      Removed value: -"Region code of the HQ country — the platform's six-value geography: EMEA (Europe AND the Middle East), AMER (North America), LATAM, APAC, AFRICA (its own region, not folded into EMEA), GLOBAL (country unknown). Case-insensitive on input; anything else is refused."
    • removedOutput schema / properties / _attribution
      Removed value: -{
      -  "type": "string"
      -}
    • removedOutput schema / properties / _meta
      Removed value: -{
      -  "type": "object"
      -}
    • removedOutput schema / properties / result_count
      Removed value: -{
      -  "type": "integer"
      -}
    • removedOutput schema / properties / rows / items
      Removed value: -{
      -  "properties": {
      -    "citation_scope": {
      -      "enum": [
      -        "record",
      -        "section_hub"
      -      ],
      -      "type": "string"
      -    },
      -    "citation_url": {
      -      "type": "string"
      -    },
      -    "n": {
      -      "type": [
      -        "integer",
      -        "null"
      -      ]
      -    },
      -    "value": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": "object"
      -}
    • removedOutput schema / properties / tool
      Removed value: -{
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "tool",
      -  "result_count",
      -  "rows",
      -  "_attribution"
      -]New value: +[
      +  "rows"
      +]
  3. Changed2 schema fields changed
    • changedInput schema / properties / by / enum
      Previous value: -[
      -  "country",
      -  "kind",
      -  "module",
      -  "sap_signal_band"
      -]New value: +[
      +  "country",
      +  "region",
      +  "kind",
      +  "module",
      +  "sap_signal_band"
      +]
    • addedInput schema / properties / region
      Added value: +{
      +  "description": "Region code of the HQ country — the platform's six-value geography: EMEA (Europe AND the Middle East), AMER (North America), LATAM, APAC, AFRICA (its own region, not folded into EMEA), GLOBAL (country unknown). Case-insensitive on input; anything else is refused.",
      +  "enum": [
      +    "EMEA",
      +    "AMER",
      +    "LATAM",
      +    "APAC",
      +    "AFRICA",
      +    "GLOBAL"
      +  ],
      +  "type": "string"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Free-text filter, matched case-insensitively."New value: +"Free-text filter, case-insensitive. EVERY word must appear in the record (substring per word, any order), so a natural-language phrase narrows the answer instead of having to match verbatim."
  5. Changed1 schema field changed
    • changedInput schema / properties / by / enum
      Previous value: -[
      -  "country",
      -  "kind",
      -  "sap_signal_band"
      -]New value: +[
      +  "country",
      +  "kind",
      +  "module",
      +  "sap_signal_band"
      +]
  6. Changed1 schema field changed
    • addedInput schema / properties / module
      Added value: +{
      +  "description": "Restrict to organisations with a DECLARED link to one SAP module code before counting, same vocabulary as search_firms' `module`. Combining it with `by:\"module\"` is legal and returns that single bucket (plus the null bucket).",
      +  "type": "string"
      +}
  7. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and closed-world, so safety is covered. The description adds return semantics beyond them: rows of value and n, with the long tail folded into '(other)', plus 'Public' indicating no auth requirement. It doesn't state approximate counts or rate limits, but the important behavioral traits are disclosed.

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 tight sentences: purpose and alternative first, output shape second. Nothing is redundant with the schema or annotations.

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?

With an output schema present, return values needn't be spelled out, yet the description still summarizes the row shape and tail-folding, which is useful. For a six-parameter aggregation tool with high schema coverage, the definition covers what an agent needs before calling; only the interaction between 'by' and the optional filters is left unreconciled.

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 83%, so the baseline is 3, and the description adds meaning by saying the filters mirror search_firms, telling the agent the filter parameters behave as they do in that sibling rather than needing a separate mental model. The by facet also drives which filter is meaningful, which is left implicit.

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?

Specific verb (count) plus resource (firm directory) and an explicit enumeration of the countable facets (country, region, kind, module, sap_signal_band). The clause 'instead of paging search_firms to tally' distinguishes it from the sibling that shares its filters.

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?

Clearly states the condition that selects this tool: aggregation instead of paginating search_firms for a tally. It also signals that the same filter set as search_firms applies. There is no explicit 'when not to use' or note about combining multiple facets, but the routing guidance is unambiguous.

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.