Skip to main content
Glama

grep

Search cached files for exact strings or regex patterns. Returns line-numbered matches quickly without disk access—seed files first via read tools.

Instructions

Search cached file contents for an exact string or regex.

Fast, exact, line-numbered matching over files already in the cache — it does NOT touch disk, so seed files first with batch_read/read (empty results usually mean the files aren't cached). For concept-level questions where you don't know the exact term, use search instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoOptional filter — an exact path, a path suffix, or a glob.
patternYesA regular expression, or a literal string when `fixed_string=true`.
max_filesNoCap on the number of files returned.
max_matchesNoCap on total matches returned across all files.
fixed_stringNoMatch `pattern` literally instead of as a regex.
context_linesNoLines of surrounding context to include per match.
case_sensitiveNoMatch case-sensitively.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo
filesNo
patternNo
truncatedNo
fixed_stringNo
context_linesNo
files_matchedNo
total_matchesNo
case_sensitiveNo
truncated_filesNo
truncated_matchesNo
Behavior5/5

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

Discloses key behaviors: operates on cache only, does not touch disk, returns line-numbered results, and empty results likely mean files aren't cached. No annotations present, so full burden carried.

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?

Two succinct paragraphs with front-loaded purpose. Every sentence adds value; no redundant or filler content.

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

Completeness5/5

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

Given 7 parameters and caching behavior, the description fully explains prerequisites, limitations, and alternatives. Output schema exists, so return values not needed.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds meaning by explaining the caching context for parameter usage, enhancing understanding beyond 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 searches cached file contents for an exact string or regex, specifying 'cached' and distinguishing from the sibling 'search' tool for concept-level queries.

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

Usage Guidelines5/5

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

Explicitly tells when to use: for exact matching on cached files. Provides prerequisite: seed files with batch_read/read. Gives alternative: use search for concept-level questions.

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

Install Server

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/CoderDayton/semantic-cache-mcp'

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