execute_isolated_script
Run shell commands inside Docker containers with built-in dangerous-pattern validation and a configurable timeout to prevent runaway scripts.
Instructions
Run a shell command string inside a container via docker exec.
Validates container_id and blocks known-dangerous command patterns
before running anything. Enforces a hard timeout via asyncio so a
runaway command can never hang the server.
Args:
container_id: Container ID or name.
command: Shell command string to run (executed via `sh -c`).
timeout_seconds: Max seconds to wait before killing the command.
Returns:
dict with stdout, stderr, exit_code, timed_out.
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": {
"container_id": "<container_id>",
"command": "<command>"
},
"name": "execute_isolated_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_id | Yes | ||
| command | Yes | ||
| timeout_seconds | No |