Skip to main content
Glama
aliphi

touchdesigner-mcp

by aliphi

td_connect

Connect a source operator's output to a destination operator's input in TouchDesigner, specifying output and input indices.

Instructions

Connect the output of one operator to the input of another operator in TouchDesigner.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_pathYesPath of the source operator
to_pathYesPath of the destination operator
from_outputNoOutput index (default 0)
to_inputNoInput index (default 0)

Implementation Reference

  • server.js:133-151 (registration)
    Registration of the 'td_connect' tool via server.tool(), defining its name, description, Zod schema for params (from_path, to_path, from_output, to_input), and the async handler that builds TouchDesigner Python code to connect two operators.
    server.tool(
      "td_connect",
      "Connect the output of one operator to the input of another operator in TouchDesigner.",
      {
        from_path: z.string().describe("Path of the source operator"),
        to_path: z.string().describe("Path of the destination operator"),
        from_output: z.number().default(0).describe("Output index (default 0)"),
        to_input: z.number().default(0).describe("Input index (default 0)"),
      },
      async ({ from_path, to_path, from_output, to_input }) => {
        const code = `
    op('${to_path}').inputConnectors[${to_input}].connect(op('${from_path}').outputConnectors[${from_output}])
    f"Connected {op('${from_path}').path} -> {op('${to_path}').path}"
    `.trim();
        const result = await tdExecute(code);
        return {
          content: [{ type: "text", text: result }],
        };
      }
  • The async handler function that receives from_path, to_path, from_output, to_input, constructs a Python script to connect operator outputs to inputs via TouchDesigner's connector API, executes it via tdExecute(), and returns the result as text content.
      async ({ from_path, to_path, from_output, to_input }) => {
        const code = `
    op('${to_path}').inputConnectors[${to_input}].connect(op('${from_path}').outputConnectors[${from_output}])
    f"Connected {op('${from_path}').path} -> {op('${to_path}').path}"
    `.trim();
        const result = await tdExecute(code);
        return {
          content: [{ type: "text", text: result }],
        };
      }
  • Zod schema for td_connect tool inputs: from_path (string), to_path (string), from_output (number, default 0), to_input (number, default 0).
    {
      from_path: z.string().describe("Path of the source operator"),
      to_path: z.string().describe("Path of the destination operator"),
      from_output: z.number().default(0).describe("Output index (default 0)"),
      to_input: z.number().default(0).describe("Input index (default 0)"),
    },
  • The tdExecute helper function that sends Python code to TouchDesigner's Web Server DAT via HTTP POST and returns the response text.
    async function tdExecute(code) {
      try {
        const res = await fetch(`${TD_HOST}:${TD_PORT}`, {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ script: code }),
        });
        const text = await res.text();
        return text;
      } catch (err) {
        return `Error connecting to TouchDesigner: ${err.message}. Is TD running with the Web Server DAT on port ${TD_PORT}?`;
      }
    }
Behavior2/5

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

Without annotations, the description carries the full burden of behavioral disclosure, but only provides the basic action. It does not mention if existing connections are overwritten, what happens with invalid paths, error handling, or the state after connection. This is insufficient for a mutation 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?

The description is a single sentence that conveys the core purpose efficiently. No unnecessary words, and it is front-loaded with the essential verb and objects.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description should provide more context to be complete. It lacks details about the effect on the TouchDesigner network, prerequisites, or return behavior. A connecting tool often has nuances about ordering or validation that are missing.

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

Parameters3/5

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

The input schema has 100% description coverage, so the baseline is 3. The description adds no additional meaning beyond the schema; it does not clarify the ordering or specifics of output/input indices. The schema already documents this adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'connect' and the specific resources: 'output of one operator' to 'input of another operator' in TouchDesigner. It is distinct from sibling tools like td_create_operator (creation), td_list_operators (listing), td_run_python (execution), and td_set_parameter (modification), making the purpose 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?

The description implies usage by stating what the tool does, but provides no explicit guidance on when to use it, when not to use it, or alternatives. Given the straightforward nature of connecting operators, the implicit guidance is adequate, but lacks depth.

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/aliphi/touchdesigner-mcp'

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