get_package_docs
Get accurate, version-specific API documentation for any npm package directly from source code, with function signatures, types, and exports.
Instructions
Get accurate, version-specific API documentation for any npm package.
WHEN TO USE THIS TOOL:
ALWAYS call this tool when the user asks about a library, package, or framework.
ALWAYS call this tool BEFORE writing code that uses an external npm dependency.
ALWAYS call this tool when you need to know function signatures, types, interfaces, classes, or exports from a package.
Call this tool when the user says things like: 'use zod', 'write with axios', 'how does fastify work', 'express route handler', 'prisma schema', 'lodash merge'.
Call this tool when a package version is mentioned: 'zod@3.23', 'express 4.18' — pass it as the 'version' parameter.
DO NOT rely on training data for package APIs — training data is months out of date. This tool fetches the EXACT version the user needs from the actual source code.
Supports:
Specific version: get_package_docs('zod', version='3.23.8')
Subpath exports: get_package_docs('zod', subpath='v4/classic')
Symbol search: get_package_docs('zod', query='transform')
Documentation is cached for 24 hours — repeated calls for the same package+version are instant.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Optional — find a specific symbol within the package. | |
| package | Yes | npm package name, e.g. 'zod', 'express', '@prisma/client' | |
| subpath | No | Optional — subpath export entry, e.g. 'v4/classic' for zod/v4/classic. | |
| version | No | Optional — exact version to fetch (e.g. '3.23.8'). Defaults to latest. |