Skip to main content
Glama

aho_corasick_search

Read-onlyIdempotent

Search text for multiple patterns at once and return every occurrence using the Aho-Corasick algorithm, enabling multi-pattern matching in one pass.

Instructions

Find all occurrences of multiple patterns in text simultaneously using the Aho-Corasick algorithm.

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": {
      "text": "<text>",
      "patterns": "<patterns>"
    },
    "name": "aho_corasick_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesText to search in
patternsYesPatterns to search for

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so safety is covered. The description adds nothing about matching semantics that the annotations cannot: whether overlapping matches are reported, case sensitivity, how empty patterns or no-match cases behave, or what the response contains. With no output schema, these gaps matter.

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?

A single sentence with no filler, and the distinguishing qualifier (multiple patterns, simultaneously) is front-loaded. Nothing is padded.

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?

With no output schema, the description should say what a match looks like (positions, per-pattern grouping, counts), and it does not. Annotations carry the safety profile and the schema carries the inputs, so it is minimally viable but incomplete for a tool whose whole value is the shape of its result set.

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% for both required parameters, so the schema already explains 'text' and 'patterns'. The description adds no semantics beyond that — no note on ordering of results per pattern, case sensitivity, or array-vs-single-pattern behavior. Baseline 3 is appropriate.

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?

States a specific verb and resource (find all occurrences of patterns in text) and pins down the distinguishing trait: multi-pattern, simultaneous matching, which separates it from single-pattern siblings like kmp_search or rabin_karp_search. It never names those siblings explicitly, so differentiation is inferential rather than stated.

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 or when-not-to-use guidance. An agent gets no signal about preferring this over a single-pattern matcher, regex_test, or text_count_occurrences when it only has one pattern or wants counts rather than positions.

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