Skip to main content
Glama

td_exec

Run Python in TouchDesigner and return printed output or the 'result' variable. Access full td namespace (ops, root, project).

Instructions

Run Python inside TouchDesigner and return its output.

The full td namespace is in scope (op, ops, root, project, ui, app, families, operator type classes). A trailing expression, or a variable named result, is returned. Reach for the structured tools first — this blocks TouchDesigner's main thread while it runs.

A script that raises still returns what it printed before the error, and result if it had been set, so a mistyped name on the last line does not cost the measurements above it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does well: it discloses main-thread blocking, the return convention (trailing expression or `result`), and that printed output is preserved even when the script raises. It does not mention that arbitrary Python may mutate the TD scene or describe timeout/security constraints, which are relevant for an execution tool.

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

Conciseness5/5

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

Three short paragraphs each earn their place: purpose, usage warning, and error behavior. The most important information is front-loaded in the first sentence, and there is no filler or repetition.

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 a single required parameter and an output schema, the description is nearly complete: it covers namespace, return semantics, error behavior, and a crucial performance warning. Minor gaps remain around side effects of arbitrary code execution and possible time limits, but nothing essential for a first correct call is missing.

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?

The schema has 0% description coverage for the single `code` parameter, so the description must compensate. It does by explaining the Python execution context, the full `td` namespace in scope, and what value is returned. It stops short of giving a concrete example or clarifying exact formatting expectations, but for a one-parameter tool this is strong compensation.

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?

The opening sentence states a concrete action and resource: 'Run Python inside TouchDesigner and return its output.' The description also separates this from the surrounding structured helpers via 'Reach for the structured tools first,' though it does not name a specific sibling tool as the alternative.

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

Usage Guidelines4/5

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

The description gives explicit routing advice: prefer the structured tools before falling back to this one, and it warns that this tool blocks TouchDesigner's main thread. It does not name which specific structured tools to prefer or state the positive condition for choosing td_exec beyond the general Python-purpose case.

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