Skip to main content
Glama

execute_blender_code

Destructive

Run Python code directly in Blender's environment to automate modeling, editing, and rendering tasks, and return results via a JSON-serialisable 'result' variable.

Instructions

Execute Python code in the connected Blender instance.

The code runs in Blender's Python environment with full access to bpy. To return data, assign a JSON-serialisable dict to a variable named result. Deferred completion via check_is_finished is only supported by the interactive addon server, and is rejected in background mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already mark this as destructive, and the description adds meaningful behavioral detail: full bpy access, a required result-variable contract, and deferred-completion limitations by mode. It does not fully describe persistent state or side effects across calls, but the annotation plus bpy-access statement largely covers the safety profile.

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 four terse, purposeful sentences with the core purpose front-loaded. Every sentence adds a distinct operational detail, and there is no filler or redundancy.

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 code-execution tool with a single parameter and an output schema, the description covers the environment, return convention, and mode-specific caveat. The main missing piece is an explicit pointer to the CLI variant for background use, which prevents it from being fully complete.

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?

The schema only defines code as a string, and the description compensates by clarifying that the code executes in Blender's Python environment, has full bpy access, and should assign a JSON-serialisable dict to result. This adds practical meaning beyond the bare parameter definition, though it does not specify whether result is optional or what happens if it is missing.

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 action and resource: executing Python code in the connected Blender instance with access to bpy. However, it does not explicitly differentiate from the sibling tool execute_blender_code_for_cli, so the agent must infer which server mode applies.

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 usage by explaining where code runs and how to return data. It also notes that deferred completion is only supported by the interactive addon server and rejected in background mode, but it never explicitly says when to prefer this tool over the CLI sibling or what conditions select one mode over the other.

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