Skip to main content
Glama

search_claude_code_docs

Search live Claude Code documentation for CLI, hooks, settings, and MCP configuration sections, returning a short answer plus a full-text Markdown report for deeper reading.

Instructions

Search the live Claude Code documentation (https://code.claude.com/docs/llms.txt and llms-full.txt) for SECTIONS of Claude Code docs pages. Best for finding Claude Code CLI, hooks, settings, and usage documentation. Returns a SHORT answer and writes the full text to a Markdown report file. The answer has the query, a "Best match: strong | weak | none (best score ...)" line (a score band, not a claim that the docs answer the query: strong is a best-section score of at least 0.5, weak at least 0.3, otherwise none), "Report: ", one line per listed section (page > heading path | sectionId | score | the line range of the section in the report and of its best-scoring window), the changelog pointer line when the changelog page matches, and the verbatim best-scoring window of the #1 section only (labelled; the answer may be elsewhere in that section, so read the listed report lines). Read or grep the report file for the full section text (code blocks intact, never truncated); the sectionIds can be used as-is with get_claude_code_doc_content. Report location: the reportsDir argument if given, else DOCS_LIBRARIAN_REPORTS_DIR if set, else $CLAUDE_PROJECT_DIR/reports_dev/cc-docs-search/ (which gets a .gitignore holding "*", so it stays untracked in any repository; report files committed there earlier need "git rm --cached"), else the folder reports/cc-docs-search inside the cache root (DOCS_LIBRARIAN_CACHE_DIR, default ~/.cache/docs-librarian-cache). Pass reportsDir only to keep a report on purpose, for example in a tracked folder. The folder is created if missing; reports in a folder given by reportsDir or DOCS_LIBRARIAN_REPORTS_DIR are never pruned (the two default folders keep the newest 50 reports), and a failed write fails the search. The report holds every section scoring at least 0.3 (at least the best one, at most 4 times maxResults). The changelog is never searched by section; when it matches, the answer carries a pointer line naming search_claude_code_changelog and get_claude_code_changelog. Latency: one live index fetch, one revalidation of llms-full.txt (about 11 MB, cached on disk and revalidated with If-Modified-Since on every call; a cold start downloads it), then two Jev passes (pages by their headings, then the windows of the sections); the whole call has a 120 s deadline and fails as a whole with TIMEOUT, never partially. Failure: any fetch failure (no stale cache is served), any Jev failure, a report write failure or the deadline fails the whole search; there is no unranked fallback. Requires Jev, which is on by default when OPENROUTER_API_KEY or TYPESAFE_API_KEY (or DOCS_LIBRARIAN_JEV_PROVIDER and its key) is set; DOCS_LIBRARIAN_JEV_RERANK=0 turns it off, and then this search fails before any request. Cost: the Jev usage of each call is the last line of the answer; measured on 2026-11-29 with 4 live queries (Jev-reported), a search cost 0.84 to 1.34 cents and took 4.3 to 6.6 s, and two early runs took 22 s (their cause was not measured).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_claude_code_docs"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesSearch query for the Claude Code documentation. Examples: "hooks", "subagents", "settings", "MCP configuration". The query must contain non-whitespace text; a blank query is rejected with an error. Limit: 2,000 characters of JSON-encoded length: escaped characters (quotes, backslashes, newlines, tabs) count twice, other control characters six times. A longer query is rejected with an error before any request is made.
maxPagesNoNumber of documentation PAGES the Jev page pass keeps for the section search (1 to 10, default 3); a larger value is rejected with an error. Counts pages, not sections. The changelog is scored by the page pass but never searched by section and never takes one of these slots. A higher value reads more pages' sections (more Jev section windows, a longer search); the best sections of the whole docs by BM25 are added regardless.
maxResultsNoMaximum number of SECTIONS listed in the answer (1 to 20, default 5); a larger value is rejected with an error. Counts sections, not pages; only sections scoring at least 0.3 are listed (the best one always is). The report file holds up to 4 times as many sections as are listed.
reportsDirNoOptional absolute folder for this search's report file. Leave it out to use the default, an untracked folder (see the tool description). Set it only to save the report on purpose in another folder, such as a tracked one. The folder is created if missing; reports in it are never pruned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv6.0.0
    • addedInput schema / properties / reportsDir
      Added value: +{
      +  "description": "Optional absolute folder for this search's report file. Leave it out to use the default, an untracked folder (see the tool description). Set it only to save the report on purpose in another folder, such as a tracked one. The folder is created if missing; reports in it are never pruned.",
      +  "type": "string"
      +}
  2. Addedv5.1.0

TDQS

A4.2/5.0
Behavior5/5

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

The annotations only declare readOnlyHint=false; the description supplies essentially all behavioral context: it writes a report file, prunes to the newest 50 in default folders, writes a .gitignore, fails the whole search on any fetch/Jev/report/timeout failure with no stale cache or unranked fallback, has a 120 s deadline, and requires Jev keys with an env-var opt-out. It also discloses cost and measured latency. This is far beyond what the annotations provide.

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

Conciseness2/5

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

Purpose and return shape are front-loaded in the first few sentences, but the bulk is operational minutiae: cache revalidation mechanics, the full reportsDir/env-var fallback chain, and measurement notes such as "measured on 2026-11-29 with 4 live queries ... two early runs took 22 s (their cause was not measured)". These details do not help an agent select or invoke the tool and make the definition far longer than needed.

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?

For a tool with no output schema and a complex pipeline (live index fetch, Jev reranking, report writing), the description fully covers return structure, follow-up reading, failure modes, prerequisites, and cost. Nothing an agent needs in order to call it correctly is missing.

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%, so the schema already documents query limits, maxPages, maxResults, and reportsDir semantics. The description adds little parameter-level meaning beyond the schema beyond reinforcing that reportsDir is only for deliberate retention and that the report holds up to 4x maxResults. Baseline 3 is appropriate when the schema carries the parameter burden.

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?

States a specific verb and resource ("Search the live Claude Code documentation ... for SECTIONS of Claude Code docs pages") and immediately narrows scope ("Best for finding Claude Code CLI, hooks, settings, and usage documentation"). It also names the changelog siblings and get_claude_code_doc_content as the follow-up reader, so the agent can distinguish it from adjacent tools without opening their schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear routing: use get_claude_code_doc_content with the returned sectionIds for full text, and use search_claude_code_changelog/get_claude_code_changelog when the changelog matches. It also gives a conditional for reportsDir ("Pass reportsDir only to keep a report on purpose"). It never states explicit when-not-to-use cases (e.g., when a plain page fetch would suffice), so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.