Search Package Docs
docs_search_docsSearch a package's real README or docs for keywords and retrieve verbatim matching snippets with surrounding context, source URL, and line hints.
Instructions
Search for keywords inside a package's real README/docs and return verbatim matching snippets with surrounding context.
This does keyword matching over the actual fetched document (registry README for npm, long description for PyPI, README-derived text for Cargo) — it does not summarize or paraphrase, and it does not answer from general knowledge. If no matches are found, it says so rather than guessing at an answer.
Args:
ecosystem ('npm' | 'pypi' | 'cargo')
package_name (string): exact package name
query (string): keyword(s) to search for, e.g. "rate limit" or "async client"
max_snippets (number, 1-20, default 5): cap on returned matches
version (string, optional): specific version to search; defaults to latest
Returns JSON with: snippets (array of {match, context, line_hint}), source_url, fetched_at.
Error Handling:
Returns "Error: ..." if the package/docs can't be fetched
Returns an empty snippets array (not an error) if the docs were fetched successfully but the query has no matches
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Keyword(s) to search for inside the package's real documentation, e.g. 'authentication middleware'. | |
| version | No | Specific version to search within. Defaults to the latest published version if omitted. | |
| ecosystem | Yes | Which package registry to query: 'npm', 'pypi', or 'cargo'. | |
| max_snippets | No | Maximum number of matching snippets to return. | |
| package_name | Yes | Exact package name as published on the registry. |