Skip to main content
Glama

grep

Search project files using regex to locate symbols or strings, automatically skipping hidden dirs and binaries for clean results.

Instructions

Regex search across files under a path inside a project root. Skips hidden dirs, node_modules, .git, binaries. Free local I/O — prefer over deep_explore for locating symbols/strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory to search, relative to a project root (default: the root itself).
excludeNoGlob patterns for paths to exclude.
includeNoGlob patterns for files to include, e.g. ["*.ts"] (default: all).
patternYesRegular expression to search for.
projectNoProject path the user named in chat (armed via init). Pass it explicitly on every call. If no project has been named, ask the user; never guess.
max_resultsNoMax matches to return (default 100).
session_tokenNoSession token returned by init (or create_project). Required for every project tool call in this chat. A new chat must be re-armed.
Behavior3/5

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

No annotations are provided, so description carries the burden. It discloses that it skips hidden dirs, node_modules, .git, and binaries, which is valuable. However, it doesn't mention any side effects (none expected), behavior on no matches, or whether it follows symlinks. It gives basic transparency but lacks depth for a search tool that could have performance implications.

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 two sentences, highly concise, and front-loaded with key info. Every sentence adds value: first defines purpose and exclusions, second gives usage guidance. No fluff. Perfect compactness.

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 and 100% parameter schema coverage, description covers the essential aspects: what it searches, what it skips, and when to prefer it. It doesn't explain return format or error behavior, but for a search tool with full schema, this is acceptable. It could mention that results are truncated but max_results param covers that. Slightly incomplete regarding output structure, but overall solid.

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% (all 7 parameters have descriptions). The description adds context about skipping binaries but doesn't detail parameter usage beyond schema. It mentions default max_results efficiently, and hints that project and session_token are required for context, but schema already covers that. With full schema coverage, 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?

The description clearly states the tool performs regex search across files under a path, distinguishing it from generic 'grep' by specifying project context. It mentions skipping certain directories and binaries, adding specificity. However, it doesn't explicitly contrast with siblings like deep_explore, though it does hint at preference.

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?

The description explicitly says 'prefer over deep_explore for locating symbols/strings', providing direct comparison with a sibling tool. It also notes free local I/O, implying when to use it (cheap operation). It clearly signals when to use this tool versus an alternative, which is excellent.

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/psrisuphan/cheap-labor'

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