UNPKG

touchdesigner-mcp-server

Version:
204 lines (201 loc) 10.3 kB
/** * Generated by orval v7.9.0 🍺 * Do not edit manually. * TouchDesigner API * OpenAPI schema for generating TouchDesigner API client code * OpenAPI spec version: 0.2.13 */ import { z as zod } from 'zod'; /** * @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.any()) }).optional().describe('Information about a TouchDesigner node') }).nullable(), "error": zod.string().nullable().describe('Error message if the operation was not successful') }); /** * @summary Get nodes in the path */ export const getNodesQueryPatternDefault = "*"; 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*\"') }); 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.any()) }).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.any()) }).optional().describe('Information about a TouchDesigner 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.any()) }).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.any()) }); 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') }); /** * 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.object({}).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') }).describe('Detailed information about a Python class or module'), "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.string().or(zod.number()).or(zod.boolean())).optional().describe('List of arguments for the method call'), "kwargs": zod.record(zod.string(), zod.any()).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.object({}).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.object({}).optional().describe('Return value of the executed script, can be any serializable value') }).describe('Result of the executed script') }).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({ "server": zod.string().describe('Server name (typically \"TouchDesigner\")'), "version": zod.string().describe('TouchDesigner version number'), "osName": zod.string().describe('Operating system name'), "osVersion": zod.string().describe('Operating system version') }).nullable(), "error": zod.string().nullable().describe('Error message if the operation was not successful') });