Skip to main content
Glama

blender_execute_code

Executes Python scripts inside Blender's main-thread namespace as a fallback, returning a value via the result variable and optionally enforcing strict JSON serialization.

Instructions

Fallback execution of arbitrary Python script inside Blender's main-thread namespace.

Parameters: code: Python script to execute. Assign to variable result for return value. strict_json: Enforce strict JSON standard serialization without mathutils conversions.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "blender_execute_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
strict_jsonNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/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. It usefully discloses the execution context (Blender's main-thread namespace, i.e. blocking execution in the app's primary thread) and that the script is arbitrary. It omits the safety profile an agent needs before running arbitrary code: that it can mutate or destroy scene data, whether undo is possible, and how errors or timeouts surface.

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?

Two sentences of framing followed by a tight per-parameter list; the key fact (what this tool is) is front-loaded and nothing is padded. The only waste is the literal "Parameters:" header, which duplicates the schema's role.

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?

A `result`-assignment convention is documented and an output schema exists, so return-value explanation is largely covered. For a code-execution escape hatch with zero annotation coverage, though, an agent still lacks side-effect, error-handling, and "prefer dedicated tools first" context.

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 coverage is 0% (bare "Code" / "Strict Json" titles), so the description must compensate, and it largely does: it explains that assigning to `result` supplies the return value and that strict_json enforces standard JSON serialization without mathutils conversion. That adds genuine meaning beyond the schema, though it doesn't characterize the shape of `result` or when strict_json is actually needed.

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?

"Fallback execution of arbitrary Python script inside Blender's main-thread namespace" gives a specific verb (execute) and resource (Python script), and the word "fallback" signals it is the escape hatch relative to the task-specific siblings. It stops short of naming any sibling, so the differentiation is implied rather than explicit.

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?

"Fallback" implies use this only when a dedicated tool cannot do the job, which is real but indirect guidance. There is no explicit statement of when not to use it, no named alternatives, and no guidance on whether to prefer blender_manage_object or blender_transform_object for common tasks.

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