run_command
Run pre-approved shell commands for installing dependencies, testing, linting, type-checking, and builds within your project or a specified subdirectory.
Instructions
Run an allowlisted shell command in the project root directory (or a subdirectory via cwd, useful for monorepos like frontend/ + backend/). Useful for installing dependencies, running tests, linting, type-checking, and builds. Only commands explicitly listed in ALLOWED_COMMANDS may be executed.
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": {
"command": "<command>"
},
"name": "run_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Directory to run the command in, relative to the project root (e.g. 'frontend' or 'backend'). Must resolve inside the project root. Defaults to the project root. Prefer this over `npm run x --prefix <dir>`, which does not reliably resolve local binaries (e.g. next, vite) on Windows. | |
| command | Yes | The command to run. Must exactly match or start with one of the allowed commands. | |
| timeout_ms | No | Maximum execution time in milliseconds before the process is killed (default: 30000) |