Check npm Package TypeScript Support
npm_package_typesChecks if an npm package includes TypeScript type definitions. Detects bundled types from types, typings, or exports fields and suggests @types/ package when missing.
Instructions
Check whether an npm package ships TypeScript type definitions.
Detects bundled types from three sources (in priority order):
typesfieldtypingsfieldexportsmap with atypescondition (modern conditional exports)
Also checks for a DefinitelyTyped (@types/) companion package when no
bundled types are found, and surfaces typesVersions (TS-version-specific
type maps) when present.
Args:
package_name (string): The npm package name
version (string, optional): Specific version to check (defaults to latest)
Returns markdown with:
Whether bundled types are present and which field declared them
Type-definitions entry path
Number of subpaths typed via
exports(when applicable)Whether a
typesVersionsmap is declaredWhether @types/ exists on DefinitelyTyped, plus its latest version
An install command when @types is needed
Examples:
"express" -> @types/express on DefinitelyTyped
"zod" -> Bundled types (TypeScript-first library)
"react" -> Bundled types via exports/types condition
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | No | Specific version to check (default: latest) | |
| package_name | Yes | npm package name |