Skip to main content
Glama

grep_docs

Read-onlyIdempotent

Search across documentation markdown using regex. Use after search_docs fails; retrieves every occurrence of literals like env vars, config keys, or flags.

Instructions

Regex search over the raw documentation markdown. Use search_docs first.

This is the last resort, not the first move. It returns raw matching lines, so it costs several times what a search costs and gives you no ranking — an unscoped grep for a common term burns ~1.5k tokens and still hits its cap.

Symbols are NOT a reason to come here: AGENTS.md, PreToolUse and --flag-name all match in search_docs. Come here only when search_docs missed, or when you need every occurrence of a literal — an env var, a config key, a flag — rather than the best passages about it.

pattern is a Python regex. Pass source unless you truly want all of them.

Indexed sources: claude-code (Claude Code), codex (OpenAI Codex), cursor (Cursor), opencode (opencode), xai (xAI / Grok).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoOne of: claude-code (Claude Code), codex (OpenAI Codex), cursor (Cursor), opencode (opencode), xai (xAI / Grok)
patternYes
ignore_caseNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already provide safety hints. Description adds behavioral traits: returns raw matching lines, costs more (~1.5k tokens for common term), no ranking, hits cap, and clarifies symbols are not a reason to use it. No contradictions 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?

Description is about 120 words, well-structured with bold emphasis and clear sections. Every sentence adds value: purpose, when to use, cost caveat, when not to use, parameter hint, source list. Front-loaded with key message.

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 tool complexity (3 parameters, output schema exists, annotations cover safety), the description covers purpose, usage, behavior, and parameter semantics adequately. No obvious gaps.

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 33% (only 'source' described). Description adds that 'pattern' is a Python regex, and advises for 'source': 'Pass `source` unless you truly want all of them.' Also lists indexed sources in description, complementing the enum. Compensates well for low coverage.

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 it does 'Regex search over the raw documentation markdown.' It distinguishes from sibling 'search_docs' by explaining it returns raw matching lines, costs more, and is a last resort. Specific verb and resource with differentiation.

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?

Explicit guidance: 'Use search_docs first.' 'Come here only when search_docs missed, or when you need *every* occurrence of a literal.' It tells when not to use (for symbols, as search_docs works) and gives examples of appropriate use cases (env var, config key, flag).

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/kiyeonjeon21/anydocs'

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