Skip to main content
Glama

rabin_karp_search

Read-onlyIdempotent

Find all occurrences of a pattern in text using the Rabin-Karp rolling hash algorithm for substring matching.

Instructions

Find all occurrences of a pattern in text using the Rabin-Karp rolling hash algorithm.

Input Schema

NameRequiredDescriptionDefault
textYesText to search in
patternYesPattern to find

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, so the safety profile is fully covered. The description adds the algorithmic approach (rolling hash), which implies average-case linear performance, but omits behaviorally relevant details: whether overlapping matches are returned, case sensitivity, empty-pattern handling, and the shape of the result.

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?

One front-loaded sentence with no filler or redundancy. Nothing could be removed without losing content.

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 two-parameter, no-output-schema utility, the description covers the core contract but leaves the return shape and match-overlap semantics unspecified. An agent knows what it does but not exactly what it gets back.

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% with two required string params, so the schema already carries both parameters. The description adds no format, encoding, or length nuance beyond 'text to search in' and 'pattern to find' — baseline 3 is correct.

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?

Specific verb and resource ("Find all occurrences of a pattern in text") plus the named algorithm, which is more informative than a generic 'search'. However it never distinguishes itself from close siblings like kmp_search, aho_corasick_search, or text_count_occurrences, so an agent still cannot tell from this text alone why it should pick Rabin-Karp.

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 when-to-use, when-not-to-use, or alternative-naming guidance at all. Given the sibling list contains kmp_search, z_algorithm, aho_corasick_search, regex_test and text_count_occurrences, the absence of any routing hint is a real gap, not a minor one.

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