pkg_expand
Retrieves exact API signatures, members, and documentation for up to five package symbols so you can write calls from the package itself instead of memory.
Instructions
Shows the exact API of up to 5 symbols of a package: constructor and overload signatures, methods, properties, enum values, documentation (XML comments, docstrings or JSDoc) and the ids of related types. The signatures are read from the package itself (NuGet: the compiled assembly; PyPI: the wheel, plus its stub package when it has no types; npm: the declaration files or the @types package), so they are the source of truth for what exists: write calls from them, not from memory. Reads only. An id that is not in the package is reported as not found while the others are still shown; more than 5 is an error. The first call for a package version downloads and indexes it. WHEN TO USE: after pkg_find gave you ids, before you write code that calls them; pass a related id back to follow a parameter or return type. To locate symbols use pkg_find, for the namespace map pkg_outline, to find a package id pkg_search.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"packageId": "<packageId>",
"identifiers": "<identifiers>"
},
"name": "pkg_expand"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guide | No | true: put the packages guide first in the result. Use on your first packages call, or when told it changed. | |
| project | No | Optional, pypi and npm only: the project folder (or its pyproject.toml or package.json) inside the workspace whose lock file decides the version; default the workspace folder. | |
| version | No | Optional: exact package version, from the project's package list or lock file. Omit for the latest stable. | |
| sections | No | Optional: comma separated sections. sig = signatures and constructors, methods, props, data = enum values, doc, rel = related type ids, or all. Default: a type gets sig, methods, props, doc, rel; a method gets sig, doc, rel; an enum gets data, doc. Unknown names are ignored. Ask for one section of a large type, e.g. 'methods'. | |
| ecosystem | No | Optional: 'nuget' (default), 'pypi' (a Python package) or 'npm' (a JavaScript or TypeScript package). | |
| packageId | Yes | Package id (NuGet), project name (PyPI) or package name (npm) | |
| workspace | No | Optional, pypi and npm only: workspace name. With it, and no version, the version comes from the project's lock file (uv.lock, poetry.lock, pdm.lock, pylock.toml; package-lock.json, pnpm-lock.yaml, yarn.lock). | |
| identifiers | Yes | Up to 5 symbol ids from pkg_find or from a 'rel' section; a full or trailing type name ('Polly.ResiliencePipeline' or 'ResiliencePipeline') also works. | |
| targetFramework | No | Optional, NuGet only: target framework such as 'net10.0' (default: the configured default) | |
| includePrerelease | No | Optional: allow prerelease when no version is given (default false; NuGet only) |