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.
Agent Tool Integration
Section titled “Agent Tool Integration”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.
Use the Tool Debugger operator to inspect exact tool definitions, schemas, and parameters.
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.
Key Features
Section titled “Key Features”- 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
Requirements
Section titled “Requirements”- ChatTD Operator: Required for logging and integration with AI workflows
- No additional Python packages required
Input/Output
Section titled “Input/Output”Inputs
Section titled “Inputs”- No direct inputs required - operates on TouchDesigner’s current operator selection state
Outputs
Section titled “Outputs”- Context Analysis: Provides structured context data through the GetTool interface
- Logging Table: Optional logging of context captures to
contextTable
Parameters
Section titled “Parameters”Page: Settings
Section titled “Page: Settings”op('tool_op_context').par.Toolname
String - Default:
network_context
op('tool_op_context').par.Includeselected
Toggle - Default:
Off
op('tool_op_context').par.Includecurrent
Toggle - Default:
Off
op('tool_op_context').par.Includehover
Toggle - Default:
Off
op('tool_op_context').par.Includeparent
Toggle - Default:
Off
op('tool_op_context').par.Includesiblings
Toggle - Default:
Off
op('tool_op_context').par.Includeconnections
Toggle - Default:
Off
op('tool_op_context').par.Includeparameters
Toggle - Default:
Off
op('tool_op_context').par.Includedefaults
Toggle - Default:
Off
op('tool_op_context').par.Includecontent
Toggle - Default:
Off
op('tool_op_context').par.Maxcontentchars
Integer - Default:
0
op('tool_op_context').par.Maxsiblings
Integer - Default:
0
op('tool_op_context').par.Analyzeperformance
Toggle - Default:
Off
op('tool_op_context').par.Enablelogging
Toggle - Default:
Off
Usage Examples
Section titled “Usage Examples”Basic Context Analysis
Section titled “Basic Context Analysis”-
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
-
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
-
Select an Operator:
- Select any operator in your TouchDesigner network
- The AI can now analyze that operator’s configuration and state
Troubleshooting Workflow
Section titled “Troubleshooting Workflow”# 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
Optimization Analysis
Section titled “Optimization Analysis”# 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
Content Extraction
Section titled “Content Extraction”# 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
Integration Examples
Section titled “Integration Examples”With Agent Operator
Section titled “With Agent Operator”Connect the Tool Op Context operator to an Agent operator workflow:
- Agent Setup: Configure an Agent operator with appropriate AI model
- Tool Registration: The Tool Op Context operator automatically registers its tool
- Context Queries: The AI can ask “What is the user currently working on?” and receive detailed context
With Chat Workflows
Section titled “With Chat Workflows”Use in conversational AI workflows:
- User Question: “Why isn’t this operator working?”
- AI Response: Uses network_context tool to analyze the selected operator
- Detailed Analysis: Provides specific troubleshooting based on actual operator state
With Automation Systems
Section titled “With Automation Systems”Integrate with automated analysis systems:
- Performance Monitoring: Regularly analyze operator performance
- Error Detection: Automatically identify problematic operators
- Optimization Suggestions: Provide ongoing optimization recommendations
Best Practices
Section titled “Best Practices”Parameter Configuration
Section titled “Parameter Configuration”- 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
Token Management
Section titled “Token Management”- 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
Workflow Integration
Section titled “Workflow Integration”- 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
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common 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
Error Messages
Section titled “Error Messages”“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
Advanced Features
Section titled “Advanced Features”Custom Analysis Types
Section titled “Custom Analysis Types”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
Token Estimation
Section titled “Token Estimation”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
Network Relationship Analysis
Section titled “Network Relationship Analysis”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.