execute_blender_code
Safely execute structured Blender modeling operations or AST-validated Python code with explicit human approval and automatic undo rollback on failure.
Instructions
Safely execute structured modeling operations or restricted AST-validated Blender Python code. All mutations require explicit trusted human approval in Blender and execute transactionally with automatic undo rollback on failure. Unrestricted eval/exec is prohibited. Supports operations: 'add_modifier', 'modify_modifier', 'remove_modifier', 'set_shade_mode', 'subdivide_mesh', 'create_material', 'assign_material', 'parent_object', 'join_objects'.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "execute_blender_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Optional Python modeling script strictly restricted to allowlisted bpy operations. Must pass static AST security validation. | |
| task_id | No | Optional task or workflow identifier for grouping related scene mutation operations. | |
| approved | No | DEPRECATED / UNTRUSTED: Client-supplied approval flags in tool arguments are not trusted as proof of human consent. Mutations must be approved through a trusted approval mechanism. | |
| operations | No | List of structured modeling operations to execute sequentially within a single transaction. | |
| transactional | No | Whether to wrap execution in a Blender undo transaction to roll back on any error. Defaults to True. |