Skip to main content
Glama
aliphi

touchdesigner-mcp

by aliphi

td_create_operator

Creates a new TouchDesigner operator with a specified type, name, and network coordinates. Supports all operator classes such as TOPs, CHOPs, SOPs, DATs, and COMPs.

Instructions

Create a new operator in TouchDesigner. Operator types use TD class names like: TOPs: constantTOP, noiseTOP, compositeTOP, levelTOP, feedbackTOP, moviefileinTOP, renderTOP CHOPs: noiseCHOP, lfoCHOP, mathCHOP, filterCHOP, constantCHOP SOPs: sphereSOP, boxSOP, gridSOP, noiseSOP, transformSOP DATs: textDAT, tableDAT, scriptDAT COMPs: geometryCOMP, cameraCOMP, lightCOMP, containerCOMP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_pathNoParent operator path, e.g. /project1/project1
op_typeYesOperator type class name, e.g. noiseTOP, sphereSOP
nameYesName for the new operator
xNoHorizontal position in network
yNoVertical position in network

Implementation Reference

  • server.js:62-96 (registration)
    Registration of the 'td_create_operator' tool via server.tool() on the MCP server instance.
    server.tool(
      "td_create_operator",
      `Create a new operator in TouchDesigner.
    Operator types use TD class names like:
      TOPs: constantTOP, noiseTOP, compositeTOP, levelTOP, feedbackTOP, moviefileinTOP, renderTOP
      CHOPs: noiseCHOP, lfoCHOP, mathCHOP, filterCHOP, constantCHOP
      SOPs: sphereSOP, boxSOP, gridSOP, noiseSOP, transformSOP
      DATs: textDAT, tableDAT, scriptDAT
      COMPs: geometryCOMP, cameraCOMP, lightCOMP, containerCOMP`,
      {
        parent_path: z
          .string()
          .default("/project1")
          .describe("Parent operator path, e.g. /project1"),
        op_type: z
          .string()
          .describe("Operator type class name, e.g. noiseTOP, sphereSOP"),
        name: z.string().describe("Name for the new operator"),
        x: z.number().default(0).describe("Horizontal position in network"),
        y: z.number().default(0).describe("Vertical position in network"),
      },
      async ({ parent_path, op_type, name, x, y }) => {
        const code = `
    n = op('${parent_path}').create(${op_type}, '${name}')
    n.nodeX = ${x}
    n.nodeY = ${y}
    result = f"Created {n.type} at {n.path}"
    result
    `.trim();
        const result = await tdExecute(code);
        return {
          content: [{ type: "text", text: result }],
        };
      }
    );
  • server.js:83-95 (handler)
    Handler async function that builds TD Python code to create an operator via op().create(), sets its position, and executes it via tdExecute.
      async ({ parent_path, op_type, name, x, y }) => {
        const code = `
    n = op('${parent_path}').create(${op_type}, '${name}')
    n.nodeX = ${x}
    n.nodeY = ${y}
    result = f"Created {n.type} at {n.path}"
    result
    `.trim();
        const result = await tdExecute(code);
        return {
          content: [{ type: "text", text: result }],
        };
      }
  • Input schema using Zod for parent_path, op_type, name, x, y parameters.
    {
      parent_path: z
        .string()
        .default("/project1")
        .describe("Parent operator path, e.g. /project1"),
      op_type: z
        .string()
        .describe("Operator type class name, e.g. noiseTOP, sphereSOP"),
      name: z.string().describe("Name for the new operator"),
      x: z.number().default(0).describe("Horizontal position in network"),
      y: z.number().default(0).describe("Vertical position in network"),
    },
  • Helper function tdExecute() that sends Python code to TouchDesigner via HTTP POST and returns the result.
    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?

With no annotations, the description carries full burden but only says 'Create a new operator' without explaining side effects, error handling, or whether it overwrites existing operators. Minimal behavioral disclosure.

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 concise: one sentence followed by a clear bulleted list of examples. No extraneous text.

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

Completeness3/5

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

The description covers basic creation but lacks details on return value, error conditions, or default behavior. Given the absence of annotations and output schema, more context would be helpful.

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 description coverage is 100%, so each parameter is already documented. The description adds value by listing example operator types, which clarifies the op_type parameter beyond the schema.

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 'Create a new operator in TouchDesigner' and provides concrete operator type examples. This distinguishes it from sibling tools like td_connect, td_list_operators, etc.

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 provides operator type examples and required parameters (op_type, name) but does not explicitly state when to use this tool vs alternatives, nor does it mention prerequisites like existing parent path.

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