Run Python in CLO
clo_execute_pythonRun Python code on CLO 3D’s main thread to handle tasks beyond built-in tools, using CLO APIs, persistent variables, and JSON or OS utilities.
Instructions
Run Python inside CLO on its main thread, for anything the other tools do not cover. In scope: utility_api, pattern_api, fabric_api, import_api, export_api, rest_api, ApiTypes (option structs such as ApiTypes.ImportExportOption()), json and os. Variables persist between calls. Returns the value of the last expression, or of a variable named result, plus anything printed. Look functions up with clo_search_api first.
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": "clo_execute_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source to execute. | |
| timeout_s | No | Seconds to wait for CLO before giving up. |