execute_python
Run arbitrary Python code inside Houdini as a last resort when no dedicated tool exists for hou.* API calls or Python-level state.
Instructions
Execute arbitrary Python code inside Houdini. LAST RESORT only.
DO NOT use this to:
Create nodes or networks → use build_network or create_node
Set parameters → use set_parameter or set_parameters
Create wrangles or write Python SOPs → use create_wrangle
Connect nodes → use connect_nodes or connect_nodes_batch
Read geometry → use get_geometry_info, get_points, sample_geometry
ONLY use this when no dedicated tool exists for the operation — i.e. hou.* API calls or Python-level state that no other tool exposes. The justification parameter is mandatory: name the dedicated tools you considered and why none covers this operation.
Args: code: Python source code to execute. justification: Which dedicated tools you considered and why none covers this operation. return_expression: Python expression to evaluate 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>",
"justification": "<justification>"
},
"name": "execute_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| justification | Yes | ||
| return_expression | No |