Run command
command_runUse this when the user asks to run a command on the approved computer, such as a build, test, Git, package manager or PowerShell command, including commands that only inspect state. Full Access uses the user account's rights; scoped grants keep their restrictions. timeoutMs is the process lifetime, up to 24 hours; a long command returns its running IDs in about two seconds, then follow it with operation_status/operation_output and stop it with operation_cancel. Do not use to scan or probe hosts other than this computer (port scans, host discovery, vulnerability checks); decline those instead. Needs the sessionId from execution_session_open and a new operationId; each call is metered as one execution. A short result is returned inline within about two seconds; otherwise keep the returned IDs for operation_status and operation_output and do not resend the call.
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": {
"sessionId": "<sessionId>",
"operationId": "<operationId>",
"command": "<command>"
},
"name": "command_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working folder relative to the selected project root (or the workspace root); omit for the root. Other tools in that folder wait while the command runs, so start a long-running server without cwd | |
| args | No | Arguments as separate strings | |
| command | Yes | Executable name or path, for example node, npm, git or powershell | |
| sessionId | Yes | executionSessionId returned by execution_session_open | |
| timeoutMs | No | Process lifetime limit in ms, 100-86400000 (default 60000; with interactive 86400000) | |
| deadlineAt | No | Optional UTC admission deadline at most 60 seconds ahead (queue start timeout, NOT process execution lifetime) | |
| interactive | No | true: keep the program's input open, for a REPL (python -i, node -i), ssh or another program that reads input; send it lines with operation_input and read its replies there. Output stays readable with operation_output. Without timeoutMs the program may run up to 24 hours; idleTimeoutMs or operation_cancel ends it sooner (optional) | |
| operationId | Yes | A new random UUID v4 for this call; reuse it only to retry this same call | |
| idleTimeoutMs | No | With interactive: stop the program after this long with no output and no input, 1000-86400000 ms (default 600000) (optional) | |
| idempotencyKey | No | Optional retry key, 8-128 chars of [A-Za-z0-9._:-]; defaults to operationId | |
| efficiencyProfile | No | Optional, unverified label of the client's model, recorded as display metadata in the device owner's local activity statistics. Omit when unknown. Never send credentials or conversation content. |