Skip to main content
Glama

Execute Blender Python Code

blender_execute_code
Destructive

Execute custom Python code with Blender's bpy API to perform complex 3D operations, create custom workflows, and access advanced functionality not covered by standard tools.

Instructions

Execute Python code using Blender's bpy API.

Provides escape hatch for complex operations not covered by other tools. Use full bpy API access.

Args:

  • code (string): Python code to execute using bpy API (max 100KB)

  • timeout (optional): Execution timeout in milliseconds (1000-180000, default: 180000)

Returns: Execution result with any output or error message

Examples:

  • List objects: [obj.name for obj in bpy.data.objects]

  • Create custom mesh: bpy.ops.mesh.primitive_cube_add(location=(1, 2, 3))

  • Get object location: bpy.data.objects['Cube'].location[:]

Use when: Complex operations, custom workflows, bpy API access Don't use when: Simple operations covered by dedicated tools

Security: Code is validated for dangerous patterns. System commands are restricted. Performance: Long-running code may hit timeout limits (default 3 minutes)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython code using bpy API
timeoutNoExecution timeout (ms)
Behavior4/5

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

The description adds valuable behavioral context beyond annotations, such as security restrictions ('Code is validated for dangerous patterns. System commands are restricted') and performance limitations ('Long-running code may hit timeout limits'). While annotations indicate destructiveHint=true, the description elaborates on the scope and constraints, though it could mention more about mutation effects.

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 well-structured with clear sections (Args, Returns, Examples, Use when, Don't use when, Security, Performance), each sentence adds value without redundancy, and it's front-loaded with the core purpose. It efficiently conveys necessary information without waste.

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?

Given the tool's complexity (executing arbitrary code) and lack of output schema, the description does a good job covering key aspects like security, performance, and usage guidelines. However, it could provide more detail on error handling or return value structure to be fully complete, as the 'Returns' section is somewhat vague.

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 100%, so the schema already documents both parameters fully. The description adds minimal extra semantics, such as noting the code uses 'bpy API' and the timeout range, but doesn't provide significant additional meaning beyond what's in the schema. This meets the baseline for high schema coverage.

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 explicitly states the tool's purpose as 'Execute Python code using Blender's bpy API,' which is a specific verb+resource combination. It clearly distinguishes this tool from its siblings by emphasizing it's an 'escape hatch for complex operations not covered by other tools,' making the distinction explicit.

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 provides explicit guidance on when to use ('Complex operations, custom workflows, bpy API access') and when not to use ('Simple operations covered by dedicated tools'). It also references alternatives by mentioning 'other tools' and 'dedicated tools,' giving clear context for selection.

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/olbboy/claudekit-blender-mcp'

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