Skip to main content
Glama

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

NameRequiredDescriptionDefault
codeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose the runtime environment (pre-defined names like resolve, project, mp, tl, H) and the return contract (last expression or a variable named `result`, plus printed output). It says nothing about execution limits, timeouts, error behavior, or whether mutations to the live project persist or are undoable — significant gaps for an unrestricted code-execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose sentence, then dense but purposeful detail on available names and return behavior. The parenthesized helper list is information-dense rather than padded, though the run-on enumeration is harder to scan than a short bulleted form would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No annotations and no output schema, so the description must cover everything; it handles the environment and return values well but leaves error handling, timeouts, and side-effect/undo semantics unstated for a tool that executes arbitrary code against a live application.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% — the single `code` parameter has no schema description — so the description must compensate. It strongly implies `code` is Python source and explains the environment and return semantics around it, but never explicitly defines the parameter's type/expectations, leaving the compensation partial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run Python against the live Resolve API') and immediately scopes it as the fallback 'for anything without a dedicated tool', which differentiates it from every dedicated sibling. It also points to api_search for API lookup, so an agent can place it relative to two different alternative paths.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear selection context: use this when no dedicated tool covers the task, and use api_search to discover functions. What is missing is a 'when not to use' caution — nothing warns that arbitrary code can mutate project state, so an agent gets selection guidance but no guardrails.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.