Skip to main content
Glama

run

Destructive

Execute Python code or scripts in Blender, preserving or resetting state; return results, printed output, and numbered errors for debugging.

Instructions

Runs code in the app's own language (Blender: Python; bpy, bmesh, mathutils ready). The namespace persists (reset=True clears it, fresh=True makes this call a one-off). Value: the last expression or result; print output and a line-numbered error trace come back too. Script (instead of 'blender -b --python x.py -- a b'): file = path (relative: looked up in cwd first, then in the server's working directory; the answer says which one ran), args = what follows '--', cwd, env = environment variables; it runs in a fresh namespace and cwd/env/sys.path are restored afterwards. Background Blender: blend = open that .blend first, clean = go back to the factory scene first (both refused in a windowed Blender). grep = regex: only the matching lines of the output are kept; if the output is cut the full text is written to a file and its path is given. timeout = seconds (code 60, script 300): when it expires the call returns but the job continues (status says 'busy'); its result is not returned.

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": {
      "app": "<app>"
    },
    "name": "run"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYes
cwdNo
envNo
argsNo
codeNo
fileNo
grepNo
blendNo
cleanNo
freshNo
resetNo
timeoutNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior5/5

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

Goes well beyond the annotations (destructive=true, readOnly=false), disclosing namespace persistence across calls and what reset/fresh do to it, that a file-mode run uses a fresh namespace with cwd/env/sys.path restored afterward, that timeout expiry returns while the job keeps running in 'busy' state with no result, and that truncated grep output is spilled to a file whose path is returned. These are exactly the side effects an agent needs to avoid corrupting state or misreading a timeout as failure. Nothing contradicts the destructive/non-readOnly annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The key fact is front-loaded, but the body is a dense semicolon-and-parenthetical chain that mixes code mode, script mode, Blender scene handling, grep filtering, and timeout semantics without headers or ordering. Nearly every clause is useful information, yet the packaging makes it slow to scan for a single parameter's behavior.

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?

For a 12-parameter, 0%-schema-coverage code executor this is close to sufficient: execution model, namespace lifetime, return channel, output filtering/truncation, and timeout behavior are all covered, and an output schema exists so return shape need not be spelled out further. Remaining gaps are the accepted values for 'app' and any permission or sandboxing constraints.

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%, so the description carries the full burden and largely succeeds: code, file (with relative-path resolution order stated), args, cwd, env, blend, clean, fresh, reset, grep, and timeout all get concrete meaning and defaults. The required 'app' parameter is only implicitly characterized ("the app's own language"), and the meaning of timeout=0 is left unstated, so it is not exhaustive.

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?

States a specific verb and resource up front: runs code in the app's own language, with the concrete example that Blender means Python with bpy/bmesh/mathutils preloaded. It is immediately distinguishable from siblings like open, scene, or api_search. It stops short of a single crisp sentence, but the purpose is unambiguous.

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?

Offers implied guidance: file/args is framed as the alternative to shelling out to 'blender -b --python x.py', and blend/clean are noted as refused in a windowed Blender, which is a real usage constraint. There is no explicit when-to-use-this-vs-another-tool or when-not-to-use statement, and no mention of preferring scene/status tools for simpler state queries.

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