touchdesigner-mcp-server
Version:
MCP server for TouchDesigner
246 lines (245 loc) • 13.3 kB
JavaScript
/**
* Generated by orval v8.19.0 🍺
* Do not edit manually.
* TouchDesigner API
* OpenAPI schema for generating TouchDesigner API client code
* OpenAPI spec version: 1.5.0
*/
import * as zod from 'zod';
/**
* @summary Get nodes in the path
*/
export const getNodesQueryPatternDefault = `*`;
export const getNodesQueryIncludePropertiesDefault = false;
export const GetNodesQueryParams = zod.object({
"parentPath": zod.string().describe('Parent path e.g., \"\/project1\"'),
"pattern": zod.string().default(getNodesQueryPatternDefault).describe('Pattern to match against node names e.g., \"null\*\"'),
"includeProperties": zod.boolean().default(getNodesQueryIncludePropertiesDefault).describe('Whether to include full node properties in the response (default false for better performance)')
});
export const GetNodesResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"nodes": zod.array(zod.object({
"id": zod.number(),
"opType": zod.string(),
"name": zod.string(),
"path": zod.string(),
"properties": zod.record(zod.string(), zod.unknown())
}).describe('Information about a TouchDesigner node')).optional().describe('Result of the execution')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* @summary Create a new node
*/
export const CreateNodeBody = zod.object({
"parentPath": zod.string().describe('Path to the parent node (e.g., \/project1)'),
"nodeType": zod.string().describe('Type of the node to create (e.g., textTop)'),
"nodeName": zod.string().optional().describe('Name of the new node (optional)')
});
export const CreateNodeResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"result": zod.object({
"id": zod.number(),
"opType": zod.string(),
"name": zod.string(),
"path": zod.string(),
"properties": zod.record(zod.string(), zod.unknown())
}).optional().describe('Result of the execution')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* @summary Delete an existing node
*/
export const DeleteNodeQueryParams = zod.object({
"nodePath": zod.string().describe('Path to the node to delete. e.g., \"\/project1\/geo1\"')
});
export const DeleteNodeResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"deleted": zod.boolean().optional().describe('Whether the node was successfully deleted'),
"node": zod.object({
"id": zod.number(),
"opType": zod.string(),
"name": zod.string(),
"path": zod.string(),
"properties": zod.record(zod.string(), zod.unknown())
}).optional().describe('Information about the deleted node')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Retrieves detailed information about a specific node including its properties, parameters and connections
* @summary Get node detail
*/
export const GetNodeDetailQueryParams = zod.object({
"nodePath": zod.string().describe('Node path. e.g., \"\/project1\/textTOP\"')
});
export const GetNodeDetailResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"id": zod.number(),
"opType": zod.string(),
"name": zod.string(),
"path": zod.string(),
"properties": zod.record(zod.string(), zod.unknown())
}).nullable().describe('Information about a TouchDesigner node'),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* @summary Update node properties
*/
export const UpdateNodeBody = zod.object({
"nodePath": zod.string().describe('Path to the node (e.g., \/project1\/null1)'),
"properties": zod.record(zod.string(), zod.unknown())
});
export const UpdateNodeResponse = zod.object({
"success": zod.boolean().describe('Whether the update operation was successful'),
"data": zod.object({
"path": zod.string().optional().describe('Path of the node that was updated'),
"updated": zod.array(zod.string()).optional().describe('List of property names that were successfully updated'),
"failed": zod.array(zod.object({
"name": zod.string().optional().describe('Name of the property that failed to update'),
"reason": zod.string().optional().describe('Reason for the failure')
})).optional().describe('List of properties that failed to update'),
"message": zod.string().optional().describe('Summary message about the update operation')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Collects TouchDesigner error messages for a node and its children
* @summary Get node errors
*/
export const GetNodeErrorsQueryParams = zod.object({
"nodePath": zod.string().describe('Absolute path to the node to inspect. e.g., \"\/project1\/text1\"')
});
export const GetNodeErrorsResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"nodePath": zod.string().describe('Path that was inspected for errors'),
"nodeName": zod.string().describe('Name of the inspected node'),
"opType": zod.string().describe('Operator type of the inspected node'),
"errorCount": zod.number().describe('Number of errors that were discovered'),
"hasErrors": zod.boolean().describe('Convenience flag indicating if any errors were found'),
"errors": zod.array(zod.object({
"nodePath": zod.string().describe('Absolute operator path that reported the error'),
"nodeName": zod.string().describe('Name of the operator'),
"opType": zod.string().describe('TouchDesigner operator type'),
"message": zod.string().describe('Error message reported by TouchDesigner')
}).describe('Single node error entry')).describe('Collection of raw node errors')
}).describe('Aggregated node error report'),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Returns a list of Python classes, modules, and functions available in TouchDesigner
* @summary Get a list of Python classes and modules
*/
export const GetTdPythonClassesResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"classes": zod.array(zod.object({
"name": zod.string().describe('Name of the class or module'),
"type": zod.enum(['class', 'module', 'function', 'object']).describe('Type of the Python entity'),
"description": zod.string().optional().describe('Description of the class or module')
}).describe('Information about a Python class or module available in TouchDesigner')).optional()
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Returns detailed information about a specific Python class, module, or function including methods, properties, and documentation
* @summary Get details of a specific Python class or module
*/
export const GetTdPythonClassDetailsParams = zod.object({
"className": zod.string().describe('Name of the class or module. e.g., \"textTOP\"')
});
export const GetTdPythonClassDetailsResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"name": zod.string().describe('Name of the class or module'),
"type": zod.enum(['class', 'module', 'function', 'object']).describe('Type of the Python entity'),
"description": zod.string().optional().describe('Description of the class or module'),
"methods": zod.array(zod.object({
"name": zod.string().describe('Method name'),
"signature": zod.string().optional().describe('Method signature including parameters'),
"description": zod.string().optional().describe('Description of the method')
}).describe('Information about a Python method')).describe('List of methods available in the class or module'),
"properties": zod.array(zod.object({
"name": zod.string().describe('Property name'),
"type": zod.string().describe('Type of the property'),
"value": zod.looseObject({}).nullish().describe('Current value of the property (if serializable)')
}).describe('Information about a Python property')).describe('List of properties available in the class or module')
}).nullable().describe('Detailed information about a Python class or module'),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Retrieve Python help() documentation for TouchDesigner modules, classes, or utilities like tdu.
* @summary Get module/class Python help documentation
*/
export const GetModuleHelpQueryParams = zod.object({
"moduleName": zod.string().describe('Module or class name (e.g., \"noiseCHOP\", \"td.noiseCHOP\", \"tdu\").')
});
export const GetModuleHelpResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"moduleName": zod.string().describe('Normalized module\/class name the help text was generated for'),
"helpText": zod.string().describe('Captured output from Python\'s help() function')
}).nullable().describe('Raw Python help() output for a TouchDesigner module or class'),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Call a method on the node at the specified path (e.g., /project1).
* This allows operations equivalent to TouchDesigner's Python API such as
* `parent_comp = op('/project1')` and `parent_comp.create('textTOP', 'myText')`.
* @summary Call a method of the specified node
*/
export const ExecNodeMethodBody = zod.object({
"nodePath": zod.string().describe('Path to the node (e.g., \/project1\/null1)'),
"method": zod.string().describe('Name of the method to call'),
"args": zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])).optional().describe('List of arguments for the method call'),
"kwargs": zod.record(zod.string(), zod.unknown()).optional().describe('Keyword arguments for the method call')
});
export const ExecNodeMethodResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"result": zod.unknown().describe('Result of the method call. Can be any type (equivalent to unknown in TypeScript).')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Execute a Python script directly in TouchDesigner.
* Multiline scripts and scripts containing comments are supported.
* The script can optionally set a `result` variable to explicitly return a value.
* This endpoint allows you to interact with TouchDesigner nodes programmatically.
* @summary Execute python code on the server
*/
export const ExecPythonScriptBody = zod.object({
"script": zod.string().describe('e.g., \"op(\'\/project1\/text_over_image\').outputConnectors[0].connect(op(\'\/project1\/out1\'))\"')
});
export const ExecPythonScriptResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"result": zod.object({
"value": zod.unknown().optional().describe('Return value of the executed script, can be any serializable value')
}).describe('Result of the executed script'),
"stdout": zod.string().optional().describe('Captured standard output (e.g. print statements) emitted while the script ran'),
"stderr": zod.string().optional().describe('Captured standard error output emitted while the script ran')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});
/**
* Returns information about the TouchDesigner
* @summary Get TouchDesigner information
*/
export const GetTdInfoResponse = zod.object({
"success": zod.boolean().describe('Whether the operation was successful'),
"data": zod.object({
"mcpApiVersion": zod.string().describe('Version of the TouchDesigner MCP API server'),
"osName": zod.string().describe('Operating system name'),
"osVersion": zod.string().describe('Operating system version'),
"server": zod.string().describe('Server name (typically \"TouchDesigner\")'),
"version": zod.string().describe('TouchDesigner version number')
}).nullable(),
"error": zod.string().nullable().describe('Error message if the operation was not successful')
});