Run Python
run_pythonExecute Python code inside Blender to access bpy, bmesh, and mathutils for tasks other tools do not cover; variable names persist and stdout, stderr, and result are returned.
Instructions
Run Python in Blender (bpy, bmesh, mathutils); names persist; set result to return it. Returns: stdout, stderr, result. WHEN TO CALL: only for what no tool covers.
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": "run_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python source | |
| timeout | No | Seconds (120) |