execute_python
Run custom Python inside Nuke to handle tasks not covered by other MCP tools; return a result plus stdout, stderr, and traceback, with optional saving for headless changes.
Instructions
Run Python in Nuke for anything the other tools do not cover.
`nuke` is pre-imported. Assign to a variable named `result` to return a JSON-serialisable value;
stdout, stderr and any traceback are returned too. Headless runs only keep changes to the script when `save` is true.
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": "execute_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| mode | No | auto | |
| save | No | ||
| script | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||