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 get td python classes

From Leeroopedia
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]}")

Related Pages

Implements Principle

Requires Environment

Page Connections

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