run_python
Execute Python code against the live DaVinci Resolve API to handle tasks without a dedicated tool, returning the last expression or printed output.
Instructions
Run Python against the live Resolve API for anything without a dedicated tool. Pre-defined: resolve, pm
(ProjectManager), project, mp (MediaPool), tl (current timeline), fusion, ms (MediaStorage), H (helpers:
H.item('V1:0'), H.items(...), H.media(ref), H.folder(path), H.frame(seconds|'tc'|'Nf'), H.sec(f), H.tc(f),
H.describe(item), H.const('EXPORT_EDL'), H.call('tool_name', **args)), os, json, time.
The value of the last expression (or a variable named result) is returned, plus printed output.
Use api_search to look up functions.
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": "run_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |