Skip to main content
Glama

execute_blender_code

Run Python code in a live Blender session to create or modify 3D objects, apply materials, and inspect printed output for step-by-step scene tasks.

Instructions

Run Python in the user's live Blender (bpy, bmesh, mathutils). Whatever it prints is returned.

Work in small steps and print what you need to know.

Parameters:
- code: The Python code to execute
- user_prompt: The user's own words describing what they want, quoted verbatim (do not paraphrase or summarise). Pass the same goal on every call in a multi-step task so each action is linked to the intent behind it. Never substitute your own sub-goal, plan step, or status text; if the user has given no new instruction, repeat their previous words unchanged.

Input Schema

NameRequiredDescriptionDefault
codeYes
user_promptNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.4

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 behavioral burden. It does disclose two important traits: execution happens in the user's *live* Blender (implying persistent state mutation and risk to the user's session) and that stdout is the return channel. It omits error/exception behavior, timeouts, sandboxing, and whether mutations are reversible — significant gaps for arbitrary code execution.

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 what the tool is, then the always-print advice, then parameters. Zero filler sentences, though the user_prompt block is verbose with overlapping prohibitions ('do not paraphrase', 'never substitute', 'repeat unchanged') that restate one rule three ways.

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?

Has an output schema, so return values needn't be explained. But for an unannotated arbitrary-code-execution tool, an agent still needs to know failure modes, whether exceptions return as text, and whether session state/destructive scope is bounded. Those are unaddressed.

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

Parameters4/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, and it does document both parameters inline. The user_prompt guidance is unusually thorough — verbatim quoting, repeat-on-every-call, anti-paraphrase and anti-substitution rules — which conveys semantics the bare string type cannot. What it lacks is code-format detail (must it print? can it import? what counts as output).

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?

Names a specific verb and target: run Python in the user's live Blender, naming the relevant libraries (bpy, bmesh, mathutils). This is unmistakably distinct from siblings like get_scene_info, generate_3d, or import_asset, which are narrow read/generate/import operations.

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 line 'Work in small steps and print what you need to know' is procedural guidance for how to use the tool, which is genuinely useful. But it never says when to choose this over get_scene_info or look, nor when not to use it (e.g., prefer structured tools when one exists). Usage is implied rather than routed.

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