td_execute
Execute Python code directly inside TouchDesigner's main thread and optionally return a value from the execution.
Instructions
Execute Python code inside TouchDesigner.
Args: code: Python code to execute in TD's main thread return_expression: Optional expression to evaluate and return after execution
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_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| return_expression | No |