Skip to main content
Glama

fast_search

Read-only

Search file contents by regular expression, using a trigram index to narrow candidate files before matching. Limit searches to a subdirectory and inspect diagnostics when needed.

Instructions

Search file contents with a regular expression. A trigram index selects the candidate files first.

Args: pattern: A regular expression, for example "def process_.*event". path: Optional subdirectory relative to the project root. selectivity_threshold: Skip the index when more than this share of files can match (default 0.10). explain: Add search diagnostics to the output.

Input Schema

NameRequiredDescriptionDefault
pathNo
explainNo
patternYes
workspaceNoProject path (default: this project)
max_tokensNo
max_resultsNo
case_insensitiveNo
selectivity_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds real behavioral detail the annotations do not: the trigram index preselects candidates and the index is skipped above the selectivity threshold. It says nothing about result truncation or output size limits, which matters for an 8-parameter, no-output-schema tool.

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?

Purpose is front-loaded in one sentence, then a compact Args block. Every line carries information; the only inefficiency is the split between the description's parameter list and the schema's properties.

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?

Given a complex 8-param tool with no output schema, the definition gives an agent enough to formulate calls: the required parameter, the scoping path, index behavior, and diagnostics. It falls short only on the undocumented tuning parameters and on any mention of truncation or result-limit behavior.

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 only 13%, so the description must compensate and it partially does: pattern, path, selectivity_threshold, and explain all get meaningful prose (selectivity_threshold especially, via the 0.10 default and skip semantics). But workspace, max_tokens, max_results, and case_insensitive get no explanation in the schema or the description, leaving half the surface opaque.

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 ("Search file contents with a regular expression") plus a concrete mechanism (trigram index preselection). It is clear what the tool does, but it never distinguishes itself from the sibling semantic_search or search_symbols, so an agent must infer which search tool to prefer.

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

Usage Guidelines3/5

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

The regex framing implies usage (exact/literal pattern matching) and the sibling list contains several overlapping search tools, yet there is no explicit statement of when to use fast_search instead of semantic_search or search_symbols. Usage is only inferable.

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