exec_in_container
Run commands inside a running container and return their output, with optional environment variables, user override, and working directory for targeted execution.
Instructions
Run a command inside a running container and return its output.
`command` is a list of strings, e.g. ["ls", "-la", "/app"].
Use `env` for extra environment variables (KEY=VALUE format),
`user` to override the user (e.g. "root"), and `workdir` for the working directory.
Examples:
exec_in_container("myapp", ["cat", "/etc/os-release"])
exec_in_container("db", ["psql", "-U", "postgres", "-c", "SELECT 1"], user="postgres")
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": "exec_in_container"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | ||
| user | No | ||
| command | Yes | ||
| workdir | No | ||
| container_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |