Skip to main content
Glama

blender_execute_python

Execute Blender Python (bpy) scripts in a live GUI or headless mode to automate scene setup, modeling, and rendering. Set RESULT to return structured JSON.

Instructions

Execute arbitrary Blender Python (bpy) script in Live GUI or Headless Blender. Set RESULT = {...} inside your code to return structured JSON.

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": "blender_execute_python"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesPython script using bpy (configure_cycles_gpu, apply_material_preset, hex_to_rgba helpers are pre-injected).
modeNoExecution mode: auto (live GUI if open, else headless), live, or headless.
blend_fileNoOptional existing .blend file to open in headless mode (original is never overwritten unless save_blend_path equals it).
save_blend_pathNoOptional output .blend file path to save the scene after the operation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden. It usefully discloses the RESULT = {...} convention for structured returns and that execution can happen in a live GUI session or headless, but says nothing about side effects on the open scene, irreversibility, timeouts, or what happens when the script raises an error — significant gaps for an arbitrary 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.

Conciseness5/5

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

Two tight sentences with zero padding: what it runs and where, then how to get structured output back. Front-loaded and easy to scan.

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 output schema exists, and the description does cover the return-value mechanism via RESULT, which is the most important missing piece. However, for an arbitrary-code tool with no annotations, error behavior and side-effect scope are absent, leaving an agent to infer failure modes.

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 100%, so code, mode, blend_file and save_blend_path are already documented in the schema, including the enum values and the non-overwrite guarantee. The description adds the RESULT convention, which is genuinely useful, but no additional meaning for the individual parameters.

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?

States a specific verb and resource: execute arbitrary Blender Python (bpy) code, in either Live GUI or Headless Blender. That cleanly separates it from the narrow siblings (create_object, render_image, etc.) as the general escape hatch, though it never explicitly says the sibling tools should be preferred for common tasks.

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

Usage Guidelines3/5

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

The description implies when to reach for it (arbitrary scripting) and names the two execution targets, but gives no explicit 'use this instead of X when...' guidance and no exclusions or prerequisites. Mode selection detail lives in the schema, not the description.

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