Skip to main content
Glama

Run Python

run_python
Destructive

Execute Python code inside Blender to access bpy, bmesh, and mathutils for tasks other tools do not cover; variable names persist and stdout, stderr, and result are returned.

Instructions

Run Python in Blender (bpy, bmesh, mathutils); names persist; set result to return it. Returns: stdout, stderr, result. WHEN TO CALL: only for what no tool covers.

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
codeYesPython source
timeoutNoSeconds (120)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare destructive, open-world, non-idempotent, non-read-only behavior, so the safety profile is covered. The description adds two genuinely useful traits beyond that: interpreter/global names persist across calls, and a value must be assigned to 'result' to be returned. It does not say what gets destroyed, whether the session file is mutated, or whether failures leave partial state changes.

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?

Very compact and front-loaded: capability, then behavioral note, then return values, then when to call. Near-verbatim clause stacking ('names persist; set result to return it') is slightly clipped but keeps every sentence load-bearing.

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

Completeness4/5

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

For a destructive, open-world execution tool, the definition covers the essentials: environment, persistence, how to return a value, the return tuple, and fallback positioning. No output schema exists, and the description does state the return fields, though it omits error/failure behavior and timeout consequences.

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 description coverage is 100%, with both 'code' and 'timeout' documented plus the 120-second default, so the baseline is 3. The description adds behavior around 'code' (persistent names, set result to return it) but says nothing about the timeout parameter's semantics, such as what happens on expiry.

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

Purpose4/5

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

Names a specific verb and resource ('Run Python in Blender') and scopes it by listing the available modules (bpy, bmesh, mathutils), so an agent knows this executes Python inside Blender rather than a generic shell. It distinguishes itself from siblings only implicitly through 'only for what no tool covers', without naming a specific alternative like run_script.

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?

'WHEN TO CALL: only for what no tool covers' is an explicit exclusion that tells the agent this is a fallback of last resort. It stops short of naming which sibling to prefer for any concrete task, so the agent must still scan the catalog.

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