search when your agent knows the topic and needs the relevant docs page. Use list when it needs to browse the available documentation set first. Use read to fetch the exact page or line range.
Use these tools when docs explain the public API better than source code, or when your agent needs to compare documented behavior against implementation behavior.
Since githits and @githits/mcp 0.17.0, documentation reads go through the same read tool as source reads. Pass the emitted docsReadTarget (or a historical pageId) as target and leave path empty; MCP clients upgrading from earlier releases must refresh their tool catalog so read appears in place of the retired docs_read.
CLI 0.23.0 adds list for explicit site: inventories as well as package and repository source trees. MCP 0.24.0 replaces docs_list and code_files with list. Refresh tool discovery after updating a local server; hosted availability depends on the deployed server version. CLI docs list still provides a package’s combined hosted and repository documentation catalog.
search — find documentation by topic
search — find documentation by topic
search is the primary discovery tool for documentation questions. It can search indexed package docs alongside code and symbols, then return documentation hits that chain into read.Use it when your agent knows the package and topic, such as an option name, guide title, error message, migration note, or API behavior.CLI usagestring
required
Discovery query string. Describe the documentation topic, API, option, behavior, or error message you need.
string
Single search target. Package format:
npm:react@18.2.0 or npm:react for latest. Repository format: https://github.com/facebook/react.string
Set to
docs when you only want documentation results. Omit it when documentation can be mixed with code and symbol results.number
Maximum results to return.
docsReadTarget URL or fragment unchanged as target to read, with no path. If no docsReadTarget is emitted, use the pageId. Hosted URLs address mutable current content. For the exact section selected by the backend, request JSON and replay the complete followUp, including its target, selector, and bounds. When constructing a read directly from a URL, add bounds only to intentionally select a page-relative range.Repository documentation hits use snapshot identity. Since 0.23.0, package-attributed repo docs display the served package target, target-relative path, and line range, matching source code headers. Prefer the generated followUp or those exact coordinates; JSON retains snapshot provenance. See search evidence for the current JSON fields.list — browse documentation pages
list — browse documentation pages
list browses the paths in one known package, repository, or hosted documentation site. Since @githits/mcp 0.24.0, it replaces the retired docs_list and code_files MCP tools. Refresh your MCP client’s tool catalog after upgrading. The hosted MCP server exposes list once GitHits deploys @githits/mcp 0.24.0 to it.Package and repository targets include documentation files shipped in their source tree. Hosted documentation is a separate inventory. Browse it with an explicit site:<host[/path]> target, such as site:expressjs.com. list does not discover sites for you. For a package’s hosted docs, run search with source set to docs, then pass the site: target from a [docs page] result header to list.Site text output prints a shared read target in the header when available. Pair listed paths with that target; a full URL row is its own read target. Paths are relative to the supplied site: target, and / denotes that target’s root. A trailing / marks a directory; a page path has no trailing /, even if its publisher URL does. Use JSON when you need exact entry kinds or per-entry read actions. Pass the site: target as target and the page path as path to read. When more entries exist, the output ends with the after cursor for the next call.To narrow a site inventory, pass target-relative paths. A selector with one leading / stays within the supplied target, and / alone selects its root. Source-only filters such as languages, file_types, and intents do not apply to sites. See the list parameters for the full reference.CLI usagelist on that package or repository target, such as npx githits@latest list npm:express@5.2.1 --recursive.npx githits@latest docs list remains available as a legacy CLI browser with its existing behavior.read — read a documentation page
read — read a documentation page
read accepts a complete documentation locator as target with no path. Since CLI and MCP 0.23.0, it also accepts an emitted site: target plus a target-relative page path, with an optional heading selector. Hosted clients receive this after the service adopts and deploys MCP 0.23.0.Repository documentation resolves to indexed file content with snapshot identity and the code read response, including its MCP JSON bounds. Hosted/crawled pages use the documentation response described below. A nonempty path does not by itself imply source code: a site target still reads hosted documentation.URL targets resolve only documentation that GitHits has already indexed. Reading an unknown URL returns a NOT_FOUND error and never enqueues crawling.A hosted docs URL fragment selects its heading and full subtree through the next equal-or-higher heading. Supplying either start_line or end_line replaces the fragment with a page-relative range on the same page. Line ranges work the same with URL targets and page IDs. In text mode, the MCP surface returns 150 lines by default and allows explicit ranges up to 300 lines per call; broader ranges truncate and report the returned range. The response carries totalLines so the agent can continue reading the next slice when needed. JSON responses retain the docsReadTarget, the stable pageId for replays, and the provenance sourceUrl — and, unlike code JSON, keep the full backend selection instead of applying the 150/300-line cap.Since githits and @githits/mcp 0.22.0, you can pass selector with a logical heading ID to read one heading’s section. The heading ID is the fragment without #, for example expressjson for #expressjson. Use it when you know the heading ID but the target has no fragment. Do not combine selector with a target that already contains a URL fragment. Either explicit bound overrides the heading selection. selector also reads indexed code symbols; see the Code tools page for symbol reads and their AMBIGUOUS, NOT_FOUND, and SNAPSHOT_UNSUPPORTED outcomes. The hosted MCP server exposes selector once GitHits deploys @githits/mcp 0.22.0 to it.CLI usagelist:npx githits@latest docs read remains available with its older flags. Use top-level read for site paths, --selector, and --start/--end.Parametersstring
required
Read target from discovery results: an emitted
docsReadTarget URL (including fragments), historical page ID, or explicit site: target with a separate page path. Pass emitted values through unchanged.string
Target-relative page path when
target is an emitted site: target. Omit for complete documentation URLs or page IDs. With a package or repository target, this is an exact source file path instead.string
Logical heading ID to read, such as
expressjson. Returns that heading’s section. Do not combine with a URL fragment in target. Added in 0.22.0.number
Starting line (1-indexed). Omit to start at line 1. Setting either bound replaces a URL fragment with a page-relative range.
number
Ending line (inclusive). Must be ≥
start_line when both are set. In text mode, omitting it returns 150 lines from start_line, and an explicit range may request up to 300 lines. Documentation JSON keeps the backend selection.number
Validated for compatibility with source reads (0–60,000 ms), but not forwarded to the documentation backend, which has no indexing wait.