Skip to content

Tool Op Context Operator

The Tool Op Context operator provides intelligent context analysis about TouchDesigner operators for AI workflows. It automatically captures detailed information about the currently selected, active, or hovered operator and formats it for consumption by AI models. This operator is essential for building AI assistants that can understand and help with TouchDesigner workflows by providing contextual information about what the user is currently working on.

The operator can analyze operator parameters, connections, performance metrics, DAT content, and network relationships to provide comprehensive insights that help AI models understand the current state of a TouchDesigner project.

🔧 GetTool Enabled 1 tool

This operator exposes 1 tool that allow Agent and Gemini Live LOPs to provide intelligent context analysis about TouchDesigner operators including parameters, connections, performance metrics, and network relationships.

The Tool Op Context operator provides the get_operator_context tool that captures detailed information about TouchDesigner operators and formats it for AI consumption, enabling context-aware assistance and intelligent workflow support.

  • Automatic Target Detection: Intelligently identifies the most relevant operator (selected > current > hover)
  • Multiple Analysis Types: Quick summary, troubleshooting, optimization, explanation, and content extraction
  • Rich Context Capture: Parameters, connections, performance, content preview, and network relationships
  • Token-Aware Output: Estimates token usage and provides content limits for efficient AI communication
  • DAT Content Analysis: Extracts and analyzes DAT content with configurable limits
  • Performance Insights: Identifies optimization opportunities and performance bottlenecks
  • ChatTD Operator: Required for logging and integration with AI workflows
  • No additional Python packages required
  • No direct inputs required - operates on TouchDesigner’s current operator selection state
  • Context Analysis: Provides structured context data through the GetTool interface
  • Logging Table: Optional logging of context captures to contextTable
Tool Name (Toolname) op('tool_op_context').par.Toolname String
Default:
network_context
Include Selected (Includeselected) op('tool_op_context').par.Includeselected Toggle
Default:
Off
Include Current (Includecurrent) op('tool_op_context').par.Includecurrent Toggle
Default:
Off
Include Hover (Includehover) op('tool_op_context').par.Includehover Toggle
Default:
Off
Include Parent Context (Includeparent) op('tool_op_context').par.Includeparent Toggle
Default:
Off
Include Siblings (Includesiblings) op('tool_op_context').par.Includesiblings Toggle
Default:
Off
Include Connections (Includeconnections) op('tool_op_context').par.Includeconnections Toggle
Default:
Off
Include Parameters (Includeparameters) op('tool_op_context').par.Includeparameters Toggle
Default:
Off
Include Defaults (Includedefaults) op('tool_op_context').par.Includedefaults Toggle
Default:
Off
Include Content Preview (Includecontent) op('tool_op_context').par.Includecontent Toggle
Default:
Off
Max Content Chars (Maxcontentchars) op('tool_op_context').par.Maxcontentchars Integer
Default:
0
Max Siblings (Maxsiblings) op('tool_op_context').par.Maxsiblings Integer
Default:
0
Analyze Performance (Analyzeperformance) op('tool_op_context').par.Analyzeperformance Toggle
Default:
Off
Enable Logging (Enablelogging) op('tool_op_context').par.Enablelogging Toggle
Default:
Off
  1. Setup the Operator:

    • Add the Tool Op Context operator to your network
    • Enable “Include Selected” and “Include Parameters”
    • Set “Max Content Chars” to 1000 for reasonable token usage
  2. Connect to AI Workflow:

    • The operator automatically provides its tool definition to AI models
    • AI models can call the network_context function to get current context
  3. Select an Operator:

    • Select any operator in your TouchDesigner network
    • The AI can now analyze that operator’s configuration and state
# AI model calls the tool with troubleshooting analysis
{
"analysis_type": "troubleshoot",
"content_limit": 2000
}

This provides:

  • Error detection and validation checks
  • Missing input identification
  • Common operator-specific issues
  • Performance problems
  • DAT content analysis for debugging
# AI model calls for optimization suggestions
{
"analysis_type": "optimize",
"content_limit": 1000
}

This provides:

  • Performance metrics and bottlenecks
  • Memory usage analysis
  • Parameter optimization suggestions
  • Data size recommendations
# AI model requests DAT content
{
"analysis_type": "get_content",
"content_limit": 5000
}

This provides:

  • Full DAT content extraction
  • Table structure analysis
  • Content formatting and truncation
  • Token usage estimation

Connect the Tool Op Context operator to an Agent operator workflow:

  1. Agent Setup: Configure an Agent operator with appropriate AI model
  2. Tool Registration: The Tool Op Context operator automatically registers its tool
  3. Context Queries: The AI can ask “What is the user currently working on?” and receive detailed context

Use in conversational AI workflows:

  1. User Question: “Why isn’t this operator working?”
  2. AI Response: Uses network_context tool to analyze the selected operator
  3. Detailed Analysis: Provides specific troubleshooting based on actual operator state

Integrate with automated analysis systems:

  1. Performance Monitoring: Regularly analyze operator performance
  2. Error Detection: Automatically identify problematic operators
  3. Optimization Suggestions: Provide ongoing optimization recommendations
  • Start Simple: Begin with just “Include Selected” and “Include Parameters”
  • Control Scope: Use “Max Siblings” and “Max Content Chars” to manage token usage
  • Performance Focus: Enable “Analyze Performance” for optimization workflows
  • Content Analysis: Use “Include Content” only when DAT analysis is needed
  • Content Limits: Set appropriate content limits based on your AI model’s context window
  • Selective Analysis: Choose specific analysis types rather than always using “quick_summary”
  • Sibling Limits: Limit sibling operator inclusion to prevent token overflow
  • Clear Tool Names: Use descriptive tool names when multiple context operators exist
  • Logging: Enable logging during development to understand context capture patterns
  • Error Handling: Monitor for invalid operators or network state issues

No Context Returned

  • Ensure an operator is selected in TouchDesigner
  • Check that “Include Selected” is enabled
  • Verify the operator is valid and accessible

Token Limits Exceeded

  • Reduce “Max Content Chars” parameter
  • Limit “Max Siblings” count
  • Use more specific analysis types

Performance Issues

  • Disable “Include Content” for large DATs
  • Reduce sibling operator inclusion
  • Limit parameter analysis scope

Missing DAT Content

  • Ensure “Include Content” is enabled
  • Check that the target operator is actually a DAT
  • Verify “Max Content Chars” is set appropriately

“No operator currently selected”

  • Select an operator in TouchDesigner before requesting context
  • Enable appropriate include options (selected/current/hover)

“Content truncated”

  • Increase “Max Content Chars” if full content is needed
  • Consider multiple requests for large content analysis

“Analysis type not supported”

  • Use supported analysis types: quick_summary, troubleshoot, optimize, explain, get_content
  • Check tool call format and parameters

The operator supports five analysis types:

  • quick_summary: General overview with key insights
  • troubleshoot: Problem identification and solutions
  • optimize: Performance and efficiency suggestions
  • explain: Detailed explanation of operator purpose and configuration
  • get_content: Full content extraction for DATs

The operator provides token count estimates to help manage AI model context limits:

  • Estimates based on character count and JSON structure
  • Provides breakdown by content section
  • Helps optimize content limits for efficient communication

When enabled, provides detailed network analysis:

  • Input/output connection mapping
  • Sibling operator relationships
  • Parent network context
  • Data flow understanding

This operator is essential for building intelligent TouchDesigner AI assistants that can understand and help with complex project workflows.