Skip to main content
Glama

td_exec_python

Destructive

Run Python code in TouchDesigner to control operators, evaluate parameters, and retrieve results. Supports optional timeout and hints for debugging.

Instructions

Execute Python code inside TouchDesigner.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython code to execute in TouchDesigner's Python environment. Has access to: op(), ops(), project, app, absTime, me, parent(), mod, ui, tdu. Set __result__ = <value> to return a value to the caller. Example: '__result__ = op("/project1/noise1").par.type.eval()'
timeout_msNoOptional per-call execution timeout in milliseconds. When omitted, TouchDesigner uses its configured default. Bounds: 100-60000 ms.
include_hintsNoIf True, attach a ``hints`` block via td_get_hints. Auto-injection still fires when the code touches restricted patterns (.text=, .par.file=, imports, OS escapes).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations already indicate destructiveHint=true and openWorldHint=true. Description adds context about available globals and return mechanism, but does not significantly expand beyond annotations.

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?

Main description is a single concise sentence. Schema descriptions are detailed but appropriately sized. Could benefit from slightly more context in the main description.

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 complexity of executing arbitrary code, description and schema together cover key aspects. Lacks explicit mention of error handling or side effects, but is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%. Description adds substantial meaning: lists available globals, gives example for code parameter; explains timeout bounds and include_hints behavior. Excellent parameter documentation.

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?

Description clearly states 'Execute Python code inside TouchDesigner', specifying verb and resource. However, it does not differentiate from siblings like td_python_help or td_python_classes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. The schema descriptions provide hints but no when-to-use/when-not-to-use context.

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/dreamrec/TDPilot'

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