Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:8beeeaaat Touchdesigner mcp update node

From Leeroopedia
Knowledge Sources
Domains Parameters, Node_Graph
Last Updated 2026-10-28 22:13 GMT

Overview

Concrete tool for writing a batch of property values onto a TouchDesigner node, with parameter-first binding, scalar attribute fallback, and per-property outcome tracking.

Description

The update_node method on `TouchDesignerApiService` resolves a node by path, iterates over a properties dict, and for each name: attempts `par.val` assignment if a matching parameter exists, falls back to `setattr` for scalar attributes, or records a failure. Returns the list of updated names, the list of failed entries (with reasons), and a summary message. Returns an error if nothing was updated.

Usage

Call this method when you need to:

  • Update a node's parameters after creation (Step 3 of the Node Creation workflow).
  • Apply a batch of parameter/attribute changes and track which ones failed.
  • Set scalar attributes like `nodeX`/`nodeY` for explicit positioning.

This method is exposed as the `update_td_node_parameters` MCP tool.

Code Reference

Source Location

  • Repository: touchdesigner-mcp
  • File: td/modules/mcp/services/api_service.py
  • Lines: L587-655 (public method)

Signature

class TouchDesignerApiService:
    def update_node(self, node_path: str, properties: dict[str, Any]) -> Result:
        """Update properties of the node at the specified path.

        For each property: tries par.val first, then setattr for scalar
        attributes, then records failure.

        Args:
            node_path: Target node path.
            properties: Dict of param/attr names → values.

        Returns:
            Result: success_result({path, updated[], failed[], message})
                    if any updated; error_result if nothing was updated.
        """

Import

from mcp.services.api_service import TouchDesignerApiService

I/O Contract

Inputs

Name Type Required Description
node_path str Yes Target node path
properties dict[str, Any] Yes Param/attr names → values to write

Outputs

Name Type Description
path str The target node path
updated list[str] Names of properties successfully updated
failed list[dict] Each entry: {name, reason} for failed updates
message str Summary (e.g. "Updated 3 properties")

Usage Examples

Update Parameters

from mcp.services.api_service import TouchDesignerApiService

service = TouchDesignerApiService()
result = service.update_node(
    node_path="/project1/text1",
    properties={
        "text": "Hello MCP",
        "resolutionw": 1920,
        "resolutionh": 1080,
    },
)
if result["success"]:
    print(f"Updated: {result['data']['updated']}")
    if result["data"]["failed"]:
        print(f"Failed: {result['data']['failed']}")

Set Explicit Position

# nodeX/nodeY are scalar attributes, not parameters — setattr path
result = service.update_node(
    node_path="/project1/noise1",
    properties={"nodeX": 300, "nodeY": -500},
)

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment