Skip to main content
Glama

search_docs

Search documentation files in a local directory using regex. Returns ranked matches with file path and line number.

Instructions

Greps for a pattern within documentation files (README, docs/**/*.md) in a local directory. Returns matching lines with file path and line number. Results ranked by relevance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirPathYesThe absolute path to the local directory to search.
patternYesThe regex pattern to search for.
filePatternNoOptional. Regex to filter which doc files to search.
contextLinesNoOptional. Number of surrounding context lines (max 5).
includePathNoOptional. Glob patterns to include.
excludePathNoOptional. Glob patterns to exclude.
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses that it searches only documentation files, returns lines with file path and line number, and ranks results. It implies a read-only operation and does not contradict any annotations. Could be improved by explicitly stating it is read-only or mentioning regex behavior, but overall adequate for a search tool.

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 three sentences with no wasted words. The first sentence states the action and scope, the second explains the output format, and the third notes ranking. Information is front-loaded and each sentence earns its place.

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 6 parameters (2 required), no output schema, and no annotations, the description covers the core functionality well. It explains the return format and scope. Minor omissions: no explicit mention of regex support or result limits, but these are common expectations for a 'grep' tool and the schema descriptions for optional parameters provide additional detail.

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 value by specifying the default file scope (README, docs/**/*.md), which is not present in the optional filePattern parameter's schema description. This extra context helps the agent understand the intended search domain.

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 greps for a pattern within documentation files (README, docs/**/*.md) in a local directory, returning matching lines with file path and line number ranked by relevance. This specific verb+resource+scope distinguishes it from siblings like find_docs (file finding) and semantic_search (semantic search).

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 clear context (searches documentation files only) but does not explicitly state when to use this tool versus alternatives like semantic_search or find_docs. No exclusions or alternative recommendations are provided, leaving the agent to infer usage based on the 'grep' mention.

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/reasvyn/docsgrep'

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