Run npm script with structured output
npm_runRuns npm scripts such as test or lint and parses Vitest/Jest output into structured per-file pass/fail results, falling back to raw output for non-test scripts.
Instructions
Runs any npm script (test, lint, etc.) and parses Vitest/Jest output into structured pass/fail results per file. Falls back to raw output for non-test scripts.
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": {
"project_dir": "<project_dir>",
"script": "<script>"
},
"name": "npm_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Extra environment variables | |
| args | No | Extra args passed after --, e.g. ['--coverage', '--verbose'] | |
| script | Yes | npm script name to run, e.g. 'test', 'lint', 'test:unit' | |
| project_dir | Yes | Absolute path to the project root | |
| timeout_seconds | No |