Skip to main content
Glama

text_count_occurrences

Read-onlyIdempotent

Counts how many times a substring appears in a text, with optional case-sensitive matching. Use it to verify frequency, validate input, or analyze repeated terms.

Instructions

Count occurrences of a substring in text.

Input Schema

NameRequiredDescriptionDefault
textYes
searchYes
case_sensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.5

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds no further behavioral context such as default case sensitivity, handling of overlapping matches, or return format, but it does not contradict the annotations and is minimally sufficient when combined with them.

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?

The description consists of a single clear sentence with no wasted words, front-loading the core action. It is appropriately sized for a simple utility tool.

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

Completeness3/5

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

For a simple counting tool with three parameters and no output schema, the description leaves gaps: it doesn't specify the default for 'case_sensitive', whether overlapping occurrences are counted, or the return type. These are minor but relevant for correct invocation, so the definition is adequate but not complete.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate, but it only implies that 'text' and 'search' are inputs without explaining the 'case_sensitive' parameter or clarifying whether 'search' is literal or regex. It adds marginal meaning beyond the bare parameter names.

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 ('count') and resource ('occurrences of a substring in text'), making the tool's function immediately clear. It does not explicitly differentiate from similar siblings like word_count or char_frequency, but the combination of verb and resource is distinctive enough for an agent to identify its purpose.

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?

No guidance is provided on when to use this tool versus alternatives (e.g., word_count, char_frequency, or text_analyse). There are no exclusions or contextual cues; the agent must infer usage from the name and description alone.

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

Deploy Server

Other Tools