Implementation:8beeeaaat Touchdesigner mcp get td python classes
| Knowledge Sources | |
|---|---|
| Domains | Introspection, API_Discovery |
| Last Updated | 2026-10-28 22:13 GMT |
Overview
Concrete tool for enumerating all public Python classes and modules available in TouchDesigner's `td` namespace via `inspect.getmembers`.
Description
The get_td_python_classes method on `TouchDesignerApiService` iterates over `inspect.getmembers(td)`, filters out private names (starting with `_`), extracts the docstring for each, and returns a catalogue of `{name, description}` entries. It is Step 1 of the Python API lookup ladder — the broad enumeration that tells you what classes exist.
Usage
Call this method when you need to:
- Discover what Python classes and modules are available in the current TD build.
- Find the correct class name before inspecting its members.
- Build a reference catalogue of the TD Python API surface.
This method is exposed as the `get_td_classes` MCP tool.
Code Reference
Source Location
- Repository: touchdesigner-mcp
- File: td/modules/mcp/services/api_service.py
- Lines: L59-75
Signature
class TouchDesignerApiService:
def get_td_python_classes(self) -> Result:
"""Get list of Python classes and modules available in TouchDesigner.
Returns:
Result: success_result with {"classes": [{name, description}]}.
"""
Import
from mcp.services.api_service import TouchDesignerApiService
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | — | — | No arguments; enumerates all public members of `td` |
Outputs
| Name | Type | Description |
|---|---|---|
| classes | list[dict] | Each entry: {name, description} |
Usage Examples
Enumerate Available Classes
from mcp.services.api_service import TouchDesignerApiService
service = TouchDesignerApiService()
result = service.get_td_python_classes()
if result["success"]:
for cls in result["data"]["classes"]:
print(f" {cls['name']}: {cls['description'][:60]}")