Check package.json for vulnerabilities
check_package_jsonUse this when the user asks to check their package.json, or the dependencies of a project, for known vulnerabilities: "check my package.json for known vulnerabilities". Pass the text of the package.json; only the names and versions in dependencies, devDependencies and optionalDependencies are read, nothing else in the file is used or kept, and nothing is stored. Do not ask for source code or tokens. Checks up to 150 npm dependencies at the version each names (ranges at their lowest version) and returns the vulnerable ones, most severe first, with the fixed version. Dependencies without an exact version (tags, urls, workspaces) are listed as skipped.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"packageJson": "{\"name\":\"demo\",\"dependencies\":{\"lodash\":\"4.17.15\",\"left-pad\":\"^1.3.0\"},\"devDependencies\":{\"typescript\":\"~5.4.0\"}}"
},
"name": "check_package_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packageJson | Yes | The text of the user's package.json. Only its dependency names and versions are read. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | Yes | ISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch. | |
| source | Yes | Who the data comes from, to cite and to check it against. | |
| status | Yes | ||
| checked | Yes | Dependencies looked up | |
| message | No | ||
| skipped | Yes | Dependencies without an exact version, not looked up | |
| truncated | Yes | ||
| cleanCount | Yes | Looked up with no known vulnerability | |
| skippedCount | Yes | ||
| vulnerablePackages | Yes |