Skip to main content
Glama

search_claude_code_docs

Read-only

Find Claude Code documentation sections for CLI, hooks, settings, and usage; get a short answer and a Markdown report with full section text 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: APPLE_DOCS_MCP_REPORTS_DIR if set, else $CLAUDE_PROJECT_DIR/reports_dev/cc-docs-search/, else a folder under the system temporary directory; the server never deletes 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 APPLE_DOCS_MCP_JEV_PROVIDER and its key) is set; APPLE_DOCS_MCP_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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv5.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With only readOnlyHint=true supplied, the description carries the full behavioral burden and does so extensively: it discloses the short answer plus report-file write, the report directory resolution order (APPLE_DOCS_MCP_REPORTS_DIR, then $CLAUDE_PROJECT_DIR/reports_dev/cc-docs-search/, then temp), that reports are never deleted, that a failed write fails the search, a 120s whole-call deadline with TIMEOUT and no partial results, no stale-cache fallback, the Jev dependency and its env-var toggles, and per-call cost figures.

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

Conciseness3/5

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

It is front-loaded with purpose and best-for guidance, and most sentences carry real information. However, it is a dense single-paragraph wall of text, and the measurement anecdote ('measured on 2026-11-29 with 4 live queries ... two early runs took 22 s (their cause was not measured)') is operational minutiae that dilutes the core guidance.

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 complex tool with no output schema, live index fetches, a Jev dependency, and a report file, the description covers return shape, failure modes, prerequisites, latency, and cost. An agent has everything needed to decide whether to call it and to interpret the answer.

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 the baseline is 3; the description adds meaning beyond the schema by tying maxResults to the report size ('at most 4 times maxResults') and reinforcing that maxPages counts pages while maxResults counts sections. This clarifies the interaction between the two parameters rather than merely restating them.

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 scopes it ('Best for finding Claude Code CLI, hooks, settings, and usage documentation'). It also distinguishes itself from siblings by noting the changelog is never searched by section and that matching changelog results are routed to search_claude_code_changelog/get_claude_code_changelog.

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 when-to-use context ('Best for finding Claude Code CLI, hooks, settings, and usage documentation') and an explicit exclusion plus alternative for changelog content. It does not explicitly contrast with other non-changelog siblings, but the domain scoping makes the choice unambiguous in practice.

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