Skip to main content
Glama

Search files (ToolAhead)

search
Read-onlyIdempotent

Return path, line, and content matches for a regular expression across your workspace. Uses prefetched results to eliminate wait time for coding agents.

Instructions

Search workspace file contents with a regular expression and return path:line:content matches. Use this instead of another grep/search tool when available: ToolAhead may return an exact prefetched result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoInclude/exclude glob, or a list; prefix exclusions with !.
pathNoFile or directory to search; defaults to the workspace.
queryNoCompatibility alias for pattern.
offsetNo1-based result offset.
patternNoRegular expression to search for.
multilineNoAllow matches across line boundaries.
head_limitNoMaximum results to return (default 200).
output_modeNoResult shape; defaults to content.
case_insensitiveNoEnable case-insensitive matching.
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already indicate read-only, idempotent, non-destructive, and closed-world behavior. The description adds value by disclosing the output format (path:line:content matches) and the potential prefetched result behavior ('ToolAhead may return an exact prefetched result'). No contradictions with annotations are present.

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 is only two sentences long, front-loaded with the core purpose and output format, followed by a concise usage recommendation. Every sentence earns its place with no fluff or repetition.

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 the tool's complexity (9 parameters, no output schema), the description provides essential context about what it does and the output shape. It does not repeat schema details but complements them with the prefetched result behavior and usage preference. Slightly more detail about the default output mode could push it to 5, but the schema covers that.

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 the baseline is 3. The description does not add meaningful parameter semantics beyond what the schema already provides; it only reiterates that 'pattern' is a regular expression and mentions output as path:line:content, but the schema already covers these details. Thus, it neither enhances nor detracts from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Search workspace file contents with a regular expression and return path:line:content matches.' It specifies the resource (workspace file contents), the action (search with a regular expression), and the output format. This effectively distinguishes it from sibling tools like read_file, list_files, edit_file, write_file, and run.

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

Usage Guidelines4/5

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

The description provides explicit guidance to prefer this tool over other grep/search tools: 'Use this instead of another grep/search tool when available.' It also explains why (ToolAhead may return an exact prefetched result). However, it does not provide explicit exclusionary guidance for when to use read_file or list_files instead, so it falls short of a 5.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/michael-ra/toolahead'

If you have feedback or need assistance with the MCP directory API, please join our Discord server