Skip to main content
Glama

grep

Read-only

Search file contents using regex patterns. Returns matching lines with file path and line number. Supports optional path glob filtering.

Instructions

Search file contents using a regular expression. Returns matching lines with file path and line number. Optimized for fast content search across all files. Optionally filter which files to search with a path glob.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYesRegular expression pattern to search for (e.g. TODO|FIXME)
path_filterNoGlob pattern to limit which files are searched (e.g. /src/**)
storeNoNamed persistent store for cross-session access. Sessions are ephemeral (one per MCP connection); named stores persist indefinitely. Omit to use the session's own namespace.
Behavior4/5

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

Annotations already declare readOnlyHint=true, which is consistent. Description adds behavioral details: returns specific format (lines with path and line number), optimization hint, and optional path filtering. No contradiction with annotations.

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?

Three concise sentences. Front-loaded with main action and result, followed by optimization and optional filtering. No redundant information.

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 no output schema, the description covers the return format adequately. Combined with schema param descriptions and readOnly annotation, it provides sufficient context for the agent. Could mention limits on pattern length, but schema already does.

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 description coverage is 100%, so the schema already documents all parameters. The description adds value by explaining the return format (matching lines with path and line number) and the nature of the path_filter (glob pattern).

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?

Clearly states it searches file contents using a regular expression and returns matching lines with file path and line number. Distinguishes from sibling tools like glob (file listing) and read (file content).

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?

Indicates it is optimized for fast content searches and optionally allows filtering by path glob. Does not explicitly state when not to use, but the context implies it is for content search, not for file listing or full reads.

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/lu-zhengda/mcp-virtual-fs'

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