Skip to main content
Glama

search_docs

Search project documentation and README files using semantic search to answer conceptual questions about how features work or system architecture.

Instructions

USE THIS TOOL for conceptual understanding and "how does X work?" questions. Search markdown documentation, READMEs, and code docstrings using semantic search.

PREREQUISITE: This tool requires indexing. If results are empty or you haven't indexed this session, call index_codebase(directory) first.

TRIGGER - Call this tool when the user asks:

  • "How does [feature] work?"

  • "Explain the architecture of..."

  • "What are the setup/installation instructions?"

  • "Show me the documentation for..."

  • "Why was this designed this way?"

  • Any question answered by README, CHANGELOG, or docstrings

IMPORTANT: This is NOT for finding code implementations. For code locations, use search_code. This tool searches DOCUMENTATION, not source code.

Uses HYBRID RETRIEVAL (BM25 keyword search + dense vector semantic search with Reciprocal Rank Fusion) to find conceptually relevant documentation even when keywords don't match exactly.

Do NOT use this tool for:

  • Finding function/class definitions (use search_code with "definition")

  • Finding where code is used (use search_code with "references")

  • Git history or commit messages (use search_history)

Args: query: A natural language question (e.g., "How does authentication work?" or "API rate limiting"). Can be conversational - semantic search handles synonyms. directory: Path to the project directory to search. top_k: Maximum results to return (default 10, max 100).

Returns: Dictionary with 'results' array. Each result includes: - content: The documentation text - file: Source file path - section: Section heading (if applicable) - line_start/line_end: Location in source - relevance_score: Hybrid search score

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo
directoryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description fully discloses behavior: it uses hybrid retrieval (BM25 + dense vector + RRF), requires indexing first, and returns specific fields. It clearly states it is read-only and does not search code. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections (PREREQUISITE, TRIGGER, IMPORTANT, Do NOT use) and front-loads the main purpose. It is slightly long but every sentence adds value; minor redundancy could be trimmed but overall effective.

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 no annotations and an output schema described in the description, the description covers all parameters, prerequisites, usage differentiation, and return format. It is complete for a search tool, addressing common agent questions about when and how to use it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds meaning to each parameter: query (natural language question, conversational), directory (path to project), top_k (max results, default 10, max 100). This compensates fully for missing schema descriptions.

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 searches documentation for conceptual understanding and 'how does X work?' questions. It specifies verb 'search' and resource 'markdown documentation, READMEs, and code docstrings', and distinguishes from sibling tools like search_code by explicitly stating it is not for code implementations.

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 provides explicit when-to-use scenarios (conceptual questions, setup, architecture) and when-not-to-use (function definitions, code references, git history). It names alternative tools (search_code, search_history) and includes a prerequisite (indexing) and trigger questions.

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/kapillamba4/code-memory'

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