Skip to main content
Glama

grep_documents

Search across document content using regex or exact pattern matching to locate specific text. Returns line-level matches with surrounding context.

Instructions

Grep across document content using pattern matching (like ripgrep).

Use this to find exact text matches, regex patterns, or specific strings across all documents. Returns line-level matches with context.

Args: pattern: The search pattern (regex by default, or exact string) regex: Whether to use regex matching (default True) case_sensitive: Whether the search is case-sensitive (default False) folder_path: Optional folder path to scope the search top_k: Max number of chunk results to return (default 20)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYes
regexNo
case_sensitiveNo
folder_pathNo
top_kNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool 'Returns line-level matches with context' and explains parameter defaults. However, it could be more explicit about the scope (all documents), any limitations (e.g., text-only content), or potential side effects. The description is adequate but not rich.

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 concise: a one-line summary followed by a docstring-style parameter list. Every sentence adds value, and the purpose is front-loaded. There is 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 has 5 parameters, 1 required, and an output schema exists, the description is mostly complete. It explains the tool's purpose, parameters, and behavior (line-level matches). However, it does not specify the document source or any limitations, which could be useful for an agent. Overall, it provides enough context for correct invocation.

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?

The input schema has 0% description coverage, so the description must compensate. The description lists each parameter with a brief explanation (e.g., pattern is 'The search pattern (regex by default, or exact string)'), adding meaning beyond the schema. While it could detail regex syntax or output structure, the coverage is good.

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's purpose: 'Grep across document content using pattern matching (like ripgrep).' It specifies the action (grep), resource (document content), and method (pattern matching). However, it does not explicitly differentiate from sibling tools like search_documents or rag_query, which also search documents but likely use different approaches.

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 description provides a clear use case: 'Use this to find exact text matches, regex patterns, or specific strings across all documents.' However, it does not include guidance on when not to use this tool or mention alternatives among sibling tools, which could help the agent choose correctly.

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/RPasquale/lightbulb-mcp'

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