Skip to main content
Glama
A-to-PC

blender-lab-mcp-client

by A-to-PC

blender_python_exec

Execute Python code inside Blender to automate scene manipulation, object editing, materials, or rendering. Returns results, captures stdout/stderr, and supports live or headless Blender sessions.

Instructions

Execute a Python script in Blender's context synchronously. Provide either 'code' (inline Python string) or 'script_path' (path to a .py file), not both. The script has access to 'bpy', 'mathutils', and an 'args' dict with your supplied arguments. Set 'result' in the script to return a JSON-serializable value. Returns the result, captured stdout/stderr, and execution duration. Use transport='bridge' for the live Blender add-on session, or transport='headless' to run the script in a separate blender -b process. For long-running tasks like baking, use blender_python_exec_async.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
codeNo
transportNobridge
blend_fileNo
script_pathNo
factory_startupNo
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It transparently states the execution is synchronous, that it returns captured stdout/stderr and duration, and that it runs either in a live session or a separate headless process. It does not explicitly warn about potential scene modifications (which is implicit in 'execute a Python script in Blender's context'), nor does it mention timeout behavior, but it covers the most important behavioral aspects for a general exec 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?

The description is efficient and well-structured. It front-loads the primary action, then explains input selection, environment, return mechanism, transport modes, and alternatives—all in a logical order with no redundant sentences. Every sentence adds value and contributes to a clear mental model.

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 tool with 7 parameters, no annotations, and an output schema that is not provided in the input, the description is fairly complete. It covers the execution model, input modes, return values, transport, and the alternative for long tasks. The only gaps are the semantics of blend_file, factory_startup, and timeout_seconds, and potential error handling details, but these are minor given the overall context.

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 0%, so the description must compensate. It explains the core parameters: code, script_path, args, and transport, plus the '__result__' mechanism. However, it does not explain blend_file, factory_startup, or timeout_seconds, which remain ambiguous from names alone. Since these are not documented in the schema either, the description only partially compensates for the coverage gap.

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?

The description clearly states the tool's purpose: 'Execute a Python script in Blender's context synchronously.' It specifies the verb (execute), resource (Blender), and the primary input (Python script). It also distinguishes itself from the async sibling by name and condition ('For long-running tasks like baking, use blender_python_exec_async'), so an agent can easily differentiate it from other Blender tools.

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

Usage Guidelines5/5

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

The description explicitly gives usage conditions: provide either 'code' or 'script_path', not both; explains the 'args' dict; specifies transport options ('bridge' vs 'headless'); and directly names the alternative for long-running tasks. It even mentions the '__result__' convention for return values. This is comprehensive guidance that leaves nothing to inference.

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