Resolve Library Name
docs_resolve_libraryResolve fuzzy or partial package names into real, ranked candidates using live registry search for npm and Cargo, with clear guidance when PyPI search is unavailable.
Instructions
Turn a fuzzy or partial name into real, ranked candidate package names, using the registry's own live search index — not a guess at what the package is probably called.
For npm this queries registry.npmjs.org's actual search API (the same one npmjs.com uses). For Cargo this queries crates.io's real search endpoint. For PyPI: there is currently no official PyPI search API (XML-RPC search was permanently disabled in 2022 and never replaced) — calling this with ecosystem 'pypi' returns an explicit message saying so rather than a fabricated or scraped result, along with a suggestion to use the exact package name with docs_get_package_info instead.
Args:
ecosystem ('npm' | 'pypi' | 'cargo')
query (string): the name or description to resolve, e.g. "react" or "async http client"
max_results (number, 1-10, default 5)
Returns JSON with: candidates (array of {name, version, description, score, url}), source_url, fetched_at.
Error Handling:
ecosystem 'pypi' always returns an explanatory message, not an error and not fabricated results
Returns "Error: ..." only for actual npm/crates.io request failures
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural-language or partial name to resolve, e.g. 'react', 'http client for python', 'serde'. | |
| ecosystem | Yes | Which registry to search: 'npm', 'pypi', or 'cargo'. Note: PyPI has no official search API (see limitation below). | |
| max_results | No | Maximum number of candidates to return. |