td_exec
Run Python in TouchDesigner and return printed output or the 'result' variable. Access full td namespace (ops, root, project).
Instructions
Run Python inside TouchDesigner and return its output.
The full td namespace is in scope (op, ops, root, project, ui, app,
families, operator type classes). A trailing expression, or a variable named
result, is returned. Reach for the structured tools first — this blocks
TouchDesigner's main thread while it runs.
A script that raises still returns what it printed before the error, and
result if it had been set, so a mistyped name on the last line does not
cost the measurements above it.
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": "td_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |