Skip to main content
Glama

Get Any Count

get_any_count

Count how many times a Python regular expression matches a given text and return the total as a count, helping quantify pattern occurrences in citation analysis.

Instructions

Count matches of a regular expression in a text. Returns {"count": n}.

Input Schema

NameRequiredDescriptionDefault
textYesText to search.
regexpYesPython regular expression (max 500 chars).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does convey that this is a pure read-only computation returning a simple count. However, it adds little else: it does not state there are no side effects, whether the match is case-sensitive or multiline by default, or how the regex dialect/limits behave beyond what the schema already says.

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?

Two short sentences, front-loaded with the operation, and no wasted preamble. The second sentence's return shape is redundant given an output schema exists, but it costs little.

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 two-parameter pure function with full schema coverage and an output schema, the description covers the essentials. Only the positioning relative to the numerous regex/count siblings is missing, which is a minor but real gap.

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 both text and regexp are already documented in the schema (including the 500-char limit and Python dialect). The description merely restates these at the same level of detail, adding no new semantics; baseline 3 applies.

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?

The description states a specific verb and resource: counting regex matches inside a text. It is unambiguous about the operation, but it never distinguishes itself from close siblings like extract_with_regex, extract_all_regex, or the many specific count tools (get_doi_count, get_ref_count, etc.), leaving the agent to infer the boundary.

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

Usage Guidelines2/5

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

There is no guidance on when to use this generic count versus the specialized counters or the extraction siblings. No prerequisites, no exclusions, no alternatives are named, so the agent must guess the intended scope.

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