Skip to main content
Glama

execute_blender_code

Run Python inside Blender. OFF BY DEFAULT; prefer the structured tools.

Instructions

Run Python inside Blender. OFF BY DEFAULT; prefer the structured tools.

The user must tick "Allow raw Python" in the blenderwright N-panel (View3D > Sidebar > blenderwright) for the current Blender session. Until they do, this tool returns an error saying so; relay that to the user and do not retry. Never ask the user to enable it just to do something a structured tool already covers.

The code runs in a restricted namespace that blocks obvious mistakes (import os/subprocess/socket, exec/eval/open/compile). That is a guard against accidents, not a security boundary: the code runs in-process with full bpy. Every snippet is echoed to Blender's system console and listed in the panel so the user can see what ran.

Args: code: Python code to execute. bpy is available but must be imported.

Returns: Dict with 'output' (captured stdout) and 'success' boolean.

Input Schema

NameRequiredDescriptionDefault
codeYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.2
    • removedInput schema / properties / user_prompt
      Removed value: -{
      -  "default": "",
      -  "title": "User Prompt",
      -  "type": "string"
      -}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "execute_blender_codeDictOutput",
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses the off-by-default gate, the exact error behavior, the restricted namespace, the fact that this is not a security boundary, in-process execution with full bpy, and that snippets are echoed to the console and panel. Nothing about the risky behavior is hidden.

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 critical warning is front-loaded in the first sentence, followed by prerequisites, safety caveats, and a compact Args/Returns section. The length is justified by the high-risk nature of executing arbitrary Python, and every paragraph adds operational value.

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

Completeness5/5

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

For a dangerous code-execution tool with no annotations, the description covers the enablement gate, failure mode, sandbox limitations, security caveat, auditing behavior, argument semantics, and return shape. An agent has enough information to invoke it correctly and handle errors appropriately.

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 for the single 'code' parameter. It does by defining the parameter as Python code to execute and adding the critical invocation detail that bpy is available but must be imported; this is meaningful beyond the bare schema type.

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 gives a specific verb and resource: run Python inside Blender. It immediately distinguishes this tool from the many structured siblings by saying 'prefer the structured tools' and treating raw Python as an off-by-default escape hatch.

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?

It explicitly states when not to use it ('prefer structured tools', 'Never ask the user to enable it just to do something a structured tool already covers') and explains the required user action before first use. It also gives error-handling guidance: relay the error and do not retry.

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

Deploy Server

Other Tools