codeact_execute
Execute multi-step Python logic in a stateful AST sandbox with persistent session variables and workspace-jailed read-only helpers for listing, reading, and searching files.
Instructions
Execute multi-step Python logic inside a stateful, zero-exec() AST sandbox. Variables persist across calls per session_id. Includes workspace-jailed read-only helpers: list_files(pattern), read_lines(rel_path, start, end), grep_files(regex, glob_filter).
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": {
"code": "<code>"
},
"name": "codeact_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python snippet to execute in the AST sandbox. | |
| session_id | No | Stateful session namespace. | default |
| reset_before | No | Clear session state before run. | |
| max_operations | No | Elementary AST node cap. |