Install, pin, or block a package version (free)
osv_install_verdictChecks npm or PyPI packages before install and returns an install, pin, block, or not_assessed verdict with reasons, a pin version, and a fix command.
Instructions
WHAT: For up to 50 npm or PyPI packages, returns verdict install, pin, block or not_assessed, with why, a pin_to version and a fix command. Advisory IDs come from OSV.dev. License, deprecation and publish age come from the public registry JSON. malicious is true only when OSV publishes a MAL- record for the version that was checked. WHEN: Before npm install or pip install, when you want one label and, if a fix exists, the version to pin plus a command you can paste. WHEN NOT: A yes/no list of advisory IDs for exact versions you already pinned (osv_query_packages) or one advisory body (osv_get_vulnerability). A whole manifest, lockfile or SBOM (osv_audit_dependencies, paid). Not a guarantee, and not a substitute for reviewing the advisory. COST: Free. No APIFY_TOKEN. Nothing is sent to Fairquery or Apify. RETURNS: One "install_verdict" row per package, in input order. verdict is install, pin, block or not_assessed. not_assessed is never install. why lists the plain reasons. pin_to and fix_command are set for pin (npm i name@version or pip install name==version). advisories holds OSV IDs only. malicious is true only for a MAL- id, otherwise false when OSV was checked, or null when it was not. deprecated, license and published_days_ago come from the registry with maintainer emails removed. A deprecated package or a version under 7 days old is named in why and does not by itself change install to another verdict. meta.disclaimer is: Not a guarantee. malicious is true only when OSV publishes a MAL- record for the version that was checked. A passing verdict is not a promise the package is safe to install. Errors: rows carry not_assessed rather than failing the whole call when one package is unknown. BEHAVIOR: Calls https://api.osv.dev (querybatch, then one GET per advisory id) and either https://registry.npmjs.org/{name} or https://pypi.org/pypi/{name}/json. Registry reads are serial, one package after another, with User-Agent Fairquery (info@getfairquery.com). No www.npmjs.com page is fetched. No package is downloaded, installed or executed. A 429 waits once and retries once. Usually a few seconds; 20 s timeout per request. PARAMETERS: packages: 1-50 objects. ecosystem is "npm" or "PyPI" only. name is the published name ("lodash", "@scope/pkg", "django"). version is optional; omit it to judge the registry latest. An unknown name or version is not_assessed. MAL- blocks. A vulnerability with no non-vulnerable published version blocks. A vulnerability with a non-vulnerable published version pins to the lowest such version at or above the one you named, or else the latest non-vulnerable version. limit/offset page the rows. Every call repeats the lookups, including a call that only changes offset. EXAMPLE: {"packages":[{"ecosystem":"npm","name":"lodash","version":"4.17.20"}]} -> verdict "pin", pin_to a fixed version, fix_command "npm i lodash@<pin_to>", advisories listing GHSA ids, malicious false.
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": {
"packages": "<packages>"
},
"name": "osv_install_verdict"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Optional page size: items to return, integer 1-50 (default 50). Example: 50 | |
| offset | No | Optional zero-based number of items to skip, integer 0-1000000 (default 0); pass nextOffset from the previous response, e.g. 100 | |
| packages | Yes | Required. 1-50 {ecosystem, name, version?} objects. Example: [{"ecosystem":"npm","name":"lodash","version":"4.17.20"}] |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | No | Tool-specific context (summary counts, cost notes, ...) | |
| count | Yes | Number of items in this page | |
| items | Yes | Result rows for this page | |
| total | Yes | Total items before paging | |
| offset | Yes | Offset of the first item in this page | |
| hasMore | Yes | True if more items exist after this page | |
| nextOffset | Yes | Offset to pass for the next page, or null |