Skip to main content
Glama

execute_blender_code

Execute Python code directly in Blender to automate 3D modeling, scene creation, and object manipulation tasks through code execution.

Instructions

Execute arbitrary Python code in Blender. Make sure to do it step-by-step by breaking it into smaller chunks.

Parameters:

  • code: The Python code to execute

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Implementation Reference

  • The implementation of the tool 'execute_blender_code'. It uses the 'get_blender_connection' helper to send an 'execute_code' command to the connected Blender instance.
    def execute_blender_code(ctx: Context, code: str) -> str:
        """
        Execute arbitrary Python code in Blender. Make sure to do it step-by-step by breaking it into smaller chunks.
        
        Parameters:
        - code: The Python code to execute
        """
        try:
            # Get the global connection
            blender = get_blender_connection()
            result = blender.send_command("execute_code", {"code": code})
            return f"Code executed successfully: {result.get('result', '')}"
        except Exception as e:
            logger.error(f"Error executing code: {str(e)}")
            return f"Error executing code: {str(e)}"
Behavior2/5

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

No annotations are provided, so the description carries the full burden. While 'arbitrary Python code' implies high flexibility and potential risk, the description fails to disclose safety implications, state persistence, undo behavior, or what execution results look like given the lack of output schema.

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?

The description is brief and front-loaded with the core purpose, though the structure mixes operational guidelines with parameter documentation in a slightly informal way ('Make sure to...'). No redundant filler sentences.

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

Completeness2/5

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

For a high-risk arbitrary code execution tool with no annotations and no output schema, the description is dangerously incomplete. It omits critical warnings about destructive capabilities, security sandboxing (or lack thereof), and how to interpret execution results.

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?

With 0% schema description coverage, the description provides minimal but essential semantic context by specifying the 'code' parameter accepts 'Python code.' However, it lacks details on expected format, Blender API conventions, or example snippets necessary for a code execution tool.

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 specific action ('Execute') and resource ('arbitrary Python code in Blender'), distinguishing it distinctly from sibling tools which focus on downloading assets, querying scene info, or importing models.

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?

Provides one specific operational guideline ('break it into smaller chunks') suggesting how to handle complex operations, but lacks explicit when-to-use/when-not-to-use guidance or mentions of safer alternatives like get_scene_info for simple queries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iflow-mcp/Eminemminem-blender-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server