@yepcode/mcp-server
Advanced tools
| import { z } from "zod"; | ||
| export declare const GetExecutionsSchema: z.ZodObject<{ | ||
| keywords: z.ZodOptional<z.ZodString>; | ||
| processId: z.ZodOptional<z.ZodString>; | ||
| status: z.ZodOptional<z.ZodEnum<["CREATED", "RUNNING", "FINISHED", "KILLED", "REJECTED", "ERROR"]>>; | ||
| from: z.ZodOptional<z.ZodString>; | ||
| to: z.ZodOptional<z.ZodString>; | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| status?: "ERROR" | "CREATED" | "RUNNING" | "FINISHED" | "KILLED" | "REJECTED" | undefined; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| processId?: string | undefined; | ||
| keywords?: string | undefined; | ||
| from?: string | undefined; | ||
| to?: string | undefined; | ||
| }, { | ||
| status?: "ERROR" | "CREATED" | "RUNNING" | "FINISHED" | "KILLED" | "REJECTED" | undefined; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| processId?: string | undefined; | ||
| keywords?: string | undefined; | ||
| from?: string | undefined; | ||
| to?: string | undefined; | ||
| }>; | ||
| export declare const GetExecutionSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const KillExecutionSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const RerunExecutionSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const GetExecutionLogsSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const executionsToolNames: { | ||
| readonly getExecutions: "get_executions"; | ||
| readonly getExecution: "get_execution"; | ||
| readonly killExecution: "kill_execution"; | ||
| readonly rerunExecution: "rerun_execution"; | ||
| readonly getExecutionLogs: "get_execution_logs"; | ||
| }; | ||
| export declare const executionsToolDefinitions: ({ | ||
| name: "get_executions"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| keywords: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| processId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| status: { | ||
| type: string; | ||
| enum: string[]; | ||
| description: string; | ||
| }; | ||
| from: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| to: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| id?: undefined; | ||
| }; | ||
| required?: undefined; | ||
| }; | ||
| } | { | ||
| name: "get_execution"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| processId?: undefined; | ||
| status?: undefined; | ||
| from?: undefined; | ||
| to?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "kill_execution"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| processId?: undefined; | ||
| status?: undefined; | ||
| from?: undefined; | ||
| to?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "rerun_execution"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| processId?: undefined; | ||
| status?: undefined; | ||
| from?: undefined; | ||
| to?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_execution_logs"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| processId?: undefined; | ||
| status?: undefined; | ||
| from?: undefined; | ||
| to?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| })[]; |
| import { z } from "zod"; | ||
| // Schema for getting executions with pagination and filtering | ||
| export const GetExecutionsSchema = z.object({ | ||
| keywords: z.string().optional().describe("Search keywords that apply to process name or execution comment (case-insensitive)"), | ||
| processId: z.string().optional().describe("Filter executions by process ID (UUID)"), | ||
| status: z.enum(["CREATED", "RUNNING", "FINISHED", "KILLED", "REJECTED", "ERROR"]).optional().describe("Filter executions by status"), | ||
| from: z.string().optional().describe("Filter executions created from this date and time (ISO 8601 format)"), | ||
| to: z.string().optional().describe("Filter executions created until this date and time (ISO 8601 format)"), | ||
| page: z.number().int().min(0).default(0).optional().describe("Page number for pagination (0-based index)"), | ||
| limit: z.number().int().min(1).max(100).default(10).optional().describe("Maximum number of executions to retrieve per page"), | ||
| }); | ||
| // Schema for getting a specific execution | ||
| export const GetExecutionSchema = z.object({ | ||
| id: z.string().describe("Unique identifier (UUID) of the execution to retrieve"), | ||
| }); | ||
| // Schema for killing an execution | ||
| export const KillExecutionSchema = z.object({ | ||
| id: z.string().describe("Unique identifier (UUID) of the execution to terminate"), | ||
| }); | ||
| // Schema for rerunning an execution | ||
| export const RerunExecutionSchema = z.object({ | ||
| id: z.string().describe("Unique identifier (UUID) of the execution to rerun"), | ||
| }); | ||
| // Schema for getting execution logs | ||
| export const GetExecutionLogsSchema = z.object({ | ||
| id: z.string().describe("Unique identifier (UUID) of the execution to get logs for"), | ||
| }); | ||
| // Tool names | ||
| export const executionsToolNames = { | ||
| getExecutions: "get_executions", | ||
| getExecution: "get_execution", | ||
| killExecution: "kill_execution", | ||
| rerunExecution: "rerun_execution", | ||
| getExecutionLogs: "get_execution_logs", | ||
| }; | ||
| // Tool definitions | ||
| export const executionsToolDefinitions = [ | ||
| { | ||
| name: executionsToolNames.getExecutions, | ||
| title: "Get Executions", | ||
| description: "Retrieves a paginated list of process executions with optional filtering by keywords, process, status, and date range. Executions represent individual runs of processes.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| keywords: { | ||
| type: "string", | ||
| description: "Search keywords that apply to process name or execution comment (case-insensitive)", | ||
| }, | ||
| processId: { | ||
| type: "string", | ||
| description: "Filter executions by process ID (UUID)", | ||
| }, | ||
| status: { | ||
| type: "string", | ||
| enum: ["CREATED", "QUEUED", "DEQUEUED", "RUNNING", "FINISHED", "KILLED", "REJECTED", "ERROR"], | ||
| description: "Filter executions by status", | ||
| }, | ||
| from: { | ||
| type: "string", | ||
| description: "Filter executions created from this date and time (ISO 8601 format)", | ||
| }, | ||
| to: { | ||
| type: "string", | ||
| description: "Filter executions created until this date and time (ISO 8601 format)", | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number for pagination (0-based index)", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Maximum number of executions to retrieve per page", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: executionsToolNames.getExecution, | ||
| title: "Get Execution", | ||
| description: "Retrieves detailed information about a specific execution including its status, parameters, results, and metadata.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the execution to retrieve", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: executionsToolNames.killExecution, | ||
| title: "Kill Execution", | ||
| description: "Terminates a running execution immediately. This operation sends a kill signal to stop the execution process and marks it as killed.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the execution to terminate", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: executionsToolNames.rerunExecution, | ||
| title: "Rerun Execution", | ||
| description: "Reruns a previously executed process with the same parameters and settings.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the execution to rerun", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: executionsToolNames.getExecutionLogs, | ||
| title: "Get Execution Logs", | ||
| description: "Retrieves the logs for a specific execution, including console output and error messages.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the execution to get logs for", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| ]; |
| import { z } from "zod"; | ||
| export declare const GetModulesSchema: z.ZodObject<{ | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }>; | ||
| export declare const CreateModuleSchema: z.ZodObject<{ | ||
| name: z.ZodString; | ||
| description: z.ZodOptional<z.ZodString>; | ||
| code: z.ZodString; | ||
| language: z.ZodEnum<["javascript", "python"]>; | ||
| tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| code: string; | ||
| language: "javascript" | "python"; | ||
| name: string; | ||
| settings?: Record<string, any> | undefined; | ||
| tags?: string[] | undefined; | ||
| description?: string | undefined; | ||
| }, { | ||
| code: string; | ||
| language: "javascript" | "python"; | ||
| name: string; | ||
| settings?: Record<string, any> | undefined; | ||
| tags?: string[] | undefined; | ||
| description?: string | undefined; | ||
| }>; | ||
| export declare const GetModuleSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const DeleteModuleSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const GetModuleVersionsSchema: z.ZodObject<{ | ||
| moduleId: z.ZodString; | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| moduleId: string; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }, { | ||
| moduleId: string; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }>; | ||
| export declare const GetModuleVersionSchema: z.ZodObject<{ | ||
| moduleId: z.ZodString; | ||
| versionId: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| moduleId: string; | ||
| versionId: string; | ||
| }, { | ||
| moduleId: string; | ||
| versionId: string; | ||
| }>; | ||
| export declare const DeleteModuleVersionSchema: z.ZodObject<{ | ||
| moduleId: z.ZodString; | ||
| versionId: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| moduleId: string; | ||
| versionId: string; | ||
| }, { | ||
| moduleId: string; | ||
| versionId: string; | ||
| }>; | ||
| export declare const GetModuleAliasesSchema: z.ZodObject<{ | ||
| moduleId: z.ZodString; | ||
| versionId: z.ZodOptional<z.ZodString>; | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| moduleId: string; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| versionId?: string | undefined; | ||
| }, { | ||
| moduleId: string; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| versionId?: string | undefined; | ||
| }>; | ||
| export declare const modulesToolNames: { | ||
| readonly getModules: "get_modules"; | ||
| readonly createModule: "create_module"; | ||
| readonly getModule: "get_module"; | ||
| readonly deleteModule: "delete_module"; | ||
| readonly getModuleVersions: "get_module_versions"; | ||
| readonly getModuleVersion: "get_module_version"; | ||
| readonly deleteModuleVersion: "delete_module_version"; | ||
| readonly getModuleAliases: "get_module_aliases"; | ||
| }; | ||
| export declare const modulesToolDefinitions: ({ | ||
| name: "get_modules"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| id?: undefined; | ||
| moduleId?: undefined; | ||
| versionId?: undefined; | ||
| }; | ||
| required?: undefined; | ||
| }; | ||
| } | { | ||
| name: "create_module"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| name: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| description: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| code: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| language: { | ||
| type: string; | ||
| enum: string[]; | ||
| description: string; | ||
| }; | ||
| tags: { | ||
| type: string; | ||
| items: { | ||
| type: string; | ||
| }; | ||
| description: string; | ||
| }; | ||
| settings: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| id?: undefined; | ||
| moduleId?: undefined; | ||
| versionId?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_module"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| moduleId?: undefined; | ||
| versionId?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "delete_module"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| moduleId?: undefined; | ||
| versionId?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_module_versions"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| moduleId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| id?: undefined; | ||
| versionId?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_module_version"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| moduleId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| versionId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| id?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "delete_module_version"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| moduleId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| versionId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| id?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_module_aliases"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| moduleId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| versionId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| name?: undefined; | ||
| description?: undefined; | ||
| code?: undefined; | ||
| language?: undefined; | ||
| tags?: undefined; | ||
| settings?: undefined; | ||
| id?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| })[]; |
| import { z } from "zod"; | ||
| // Schema for getting modules with pagination | ||
| export const GetModulesSchema = z.object({ | ||
| page: z.number().int().min(0).default(0).optional().describe("Page number for pagination (0-based index)"), | ||
| limit: z.number().int().min(1).max(100).default(10).optional().describe("Maximum number of modules to retrieve per page"), | ||
| }); | ||
| // Schema for creating a module | ||
| export const CreateModuleSchema = z.object({ | ||
| name: z.string().describe("Module name"), | ||
| description: z.string().optional().describe("Module description"), | ||
| code: z.string().describe("Module source code"), | ||
| language: z.enum(["javascript", "python"]).describe("Programming language"), | ||
| tags: z.array(z.string()).optional().describe("Module tags"), | ||
| settings: z.record(z.any()).optional().describe("Module settings"), | ||
| }); | ||
| // Schema for getting a specific module | ||
| export const GetModuleSchema = z.object({ | ||
| id: z.string().describe("Unique identifier (UUID) of the script library module to retrieve"), | ||
| }); | ||
| // Schema for deleting a module | ||
| export const DeleteModuleSchema = z.object({ | ||
| id: z.string().describe("Unique identifier (UUID) of the script library module to delete"), | ||
| }); | ||
| // Schema for getting module versions | ||
| export const GetModuleVersionsSchema = z.object({ | ||
| moduleId: z.string().describe("Module ID"), | ||
| page: z.number().int().min(0).default(0).optional().describe("Page number"), | ||
| limit: z.number().int().min(1).max(100).default(10).optional().describe("Amount of items to retrieve"), | ||
| }); | ||
| // Schema for getting a specific module version | ||
| export const GetModuleVersionSchema = z.object({ | ||
| moduleId: z.string().describe("Module ID"), | ||
| versionId: z.string().describe("Version ID"), | ||
| }); | ||
| // Schema for deleting a module version | ||
| export const DeleteModuleVersionSchema = z.object({ | ||
| moduleId: z.string().describe("Module ID"), | ||
| versionId: z.string().describe("Version ID"), | ||
| }); | ||
| // Schema for getting module aliases | ||
| export const GetModuleAliasesSchema = z.object({ | ||
| moduleId: z.string().describe("Module ID"), | ||
| versionId: z.string().optional().describe("Version ID"), | ||
| page: z.number().int().min(0).default(0).optional().describe("Page number"), | ||
| limit: z.number().int().min(1).max(100).default(10).optional().describe("Amount of items to retrieve"), | ||
| }); | ||
| // Tool names | ||
| export const modulesToolNames = { | ||
| getModules: "get_modules", | ||
| createModule: "create_module", | ||
| getModule: "get_module", | ||
| deleteModule: "delete_module", | ||
| getModuleVersions: "get_module_versions", | ||
| getModuleVersion: "get_module_version", | ||
| deleteModuleVersion: "delete_module_version", | ||
| getModuleAliases: "get_module_aliases", | ||
| }; | ||
| // Tool definitions | ||
| export const modulesToolDefinitions = [ | ||
| { | ||
| name: modulesToolNames.getModules, | ||
| title: "Get Modules", | ||
| description: "Retrieves a paginated list of script library modules. Modules are reusable code libraries that can be imported and used across different processes.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number for pagination (0-based index)", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Maximum number of modules to retrieve per page", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.createModule, | ||
| title: "Create Module", | ||
| description: "Creates a new script library module with source code and metadata. Modules can be written in JavaScript or Python and can be imported by processes.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| name: { | ||
| type: "string", | ||
| description: "Module name", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| description: "Module description", | ||
| }, | ||
| code: { | ||
| type: "string", | ||
| description: "Module source code", | ||
| }, | ||
| language: { | ||
| type: "string", | ||
| enum: ["javascript", "python"], | ||
| description: "Programming language", | ||
| }, | ||
| tags: { | ||
| type: "array", | ||
| items: { type: "string" }, | ||
| description: "Module tags", | ||
| }, | ||
| settings: { | ||
| type: "object", | ||
| description: "Module settings", | ||
| }, | ||
| }, | ||
| required: ["name", "code", "language"], | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.getModule, | ||
| title: "Get Module", | ||
| description: "Retrieves detailed information about a specific script library module including its source code, metadata, and version information.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the script library module to retrieve", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.deleteModule, | ||
| title: "Delete Module", | ||
| description: "Deletes a script library module and all its versions. This action cannot be undone.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the script library module to delete", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.getModuleVersions, | ||
| title: "Get Module Versions", | ||
| description: "Retrieves a paginated list of versions for a specific module.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| moduleId: { | ||
| type: "string", | ||
| description: "Module ID", | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Amount of items to retrieve", | ||
| }, | ||
| }, | ||
| required: ["moduleId"], | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.getModuleVersion, | ||
| title: "Get Module Version", | ||
| description: "Retrieves detailed information about a specific module version.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| moduleId: { | ||
| type: "string", | ||
| description: "Module ID", | ||
| }, | ||
| versionId: { | ||
| type: "string", | ||
| description: "Version ID", | ||
| }, | ||
| }, | ||
| required: ["moduleId", "versionId"], | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.deleteModuleVersion, | ||
| title: "Delete Module Version", | ||
| description: "Deletes a specific module version. This action cannot be undone.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| moduleId: { | ||
| type: "string", | ||
| description: "Module ID", | ||
| }, | ||
| versionId: { | ||
| type: "string", | ||
| description: "Version ID", | ||
| }, | ||
| }, | ||
| required: ["moduleId", "versionId"], | ||
| }, | ||
| }, | ||
| { | ||
| name: modulesToolNames.getModuleAliases, | ||
| title: "Get Module Aliases", | ||
| description: "Retrieves a paginated list of version aliases for a specific module.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| moduleId: { | ||
| type: "string", | ||
| description: "Module ID", | ||
| }, | ||
| versionId: { | ||
| type: "string", | ||
| description: "Version ID", | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Amount of items to retrieve", | ||
| }, | ||
| }, | ||
| required: ["moduleId"], | ||
| }, | ||
| }, | ||
| ]; |
| import { z } from "zod"; | ||
| export declare const GetProcessesSchema: z.ZodObject<{ | ||
| keywords: z.ZodOptional<z.ZodString>; | ||
| tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| keywords?: string | undefined; | ||
| tags?: string[] | undefined; | ||
| }, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| keywords?: string | undefined; | ||
| tags?: string[] | undefined; | ||
| }>; | ||
| export declare const CreateProcessSchema: z.ZodObject<{ | ||
| name: z.ZodString; | ||
| slug: z.ZodOptional<z.ZodString>; | ||
| description: z.ZodOptional<z.ZodString>; | ||
| readme: z.ZodOptional<z.ZodString>; | ||
| programmingLanguage: z.ZodEnum<["JAVASCRIPT", "PYTHON"]>; | ||
| sourceCode: z.ZodString; | ||
| parametersSchema: z.ZodOptional<z.ZodString>; | ||
| webhook: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| manifest: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| name: string; | ||
| programmingLanguage: "JAVASCRIPT" | "PYTHON"; | ||
| sourceCode: string; | ||
| settings?: Record<string, any> | undefined; | ||
| tags?: string[] | undefined; | ||
| slug?: string | undefined; | ||
| description?: string | undefined; | ||
| readme?: string | undefined; | ||
| parametersSchema?: string | undefined; | ||
| webhook?: Record<string, any> | undefined; | ||
| manifest?: Record<string, any> | undefined; | ||
| }, { | ||
| name: string; | ||
| programmingLanguage: "JAVASCRIPT" | "PYTHON"; | ||
| sourceCode: string; | ||
| settings?: Record<string, any> | undefined; | ||
| tags?: string[] | undefined; | ||
| slug?: string | undefined; | ||
| description?: string | undefined; | ||
| readme?: string | undefined; | ||
| parametersSchema?: string | undefined; | ||
| webhook?: Record<string, any> | undefined; | ||
| manifest?: Record<string, any> | undefined; | ||
| }>; | ||
| export declare const GetProcessSchema: z.ZodObject<{ | ||
| identifier: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| identifier: string; | ||
| }, { | ||
| identifier: string; | ||
| }>; | ||
| export declare const DeleteProcessSchema: z.ZodObject<{ | ||
| identifier: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| identifier: string; | ||
| }, { | ||
| identifier: string; | ||
| }>; | ||
| export declare const GetProcessVersionsSchema: z.ZodObject<{ | ||
| processId: z.ZodString; | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| processId: string; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }, { | ||
| processId: string; | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }>; | ||
| export declare const ExecuteProcessAsyncSchema: z.ZodObject<{ | ||
| identifier: z.ZodString; | ||
| parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| initiatedBy: z.ZodOptional<z.ZodString>; | ||
| settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| identifier: string; | ||
| settings?: Record<string, any> | undefined; | ||
| parameters?: Record<string, any> | undefined; | ||
| initiatedBy?: string | undefined; | ||
| }, { | ||
| identifier: string; | ||
| settings?: Record<string, any> | undefined; | ||
| parameters?: Record<string, any> | undefined; | ||
| initiatedBy?: string | undefined; | ||
| }>; | ||
| export declare const ExecuteProcessSyncSchema: z.ZodObject<{ | ||
| identifier: z.ZodString; | ||
| parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| initiatedBy: z.ZodOptional<z.ZodString>; | ||
| settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| identifier: string; | ||
| settings?: Record<string, any> | undefined; | ||
| parameters?: Record<string, any> | undefined; | ||
| initiatedBy?: string | undefined; | ||
| }, { | ||
| identifier: string; | ||
| settings?: Record<string, any> | undefined; | ||
| parameters?: Record<string, any> | undefined; | ||
| initiatedBy?: string | undefined; | ||
| }>; | ||
| export declare const ScheduleProcessSchema: z.ZodObject<{ | ||
| identifier: z.ZodString; | ||
| parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| type: z.ZodEnum<["PERIODIC", "ONCE"]>; | ||
| cron: z.ZodOptional<z.ZodString>; | ||
| dateTime: z.ZodOptional<z.ZodString>; | ||
| settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| type: "PERIODIC" | "ONCE"; | ||
| identifier: string; | ||
| settings?: Record<string, any> | undefined; | ||
| parameters?: Record<string, any> | undefined; | ||
| cron?: string | undefined; | ||
| dateTime?: string | undefined; | ||
| }, { | ||
| type: "PERIODIC" | "ONCE"; | ||
| identifier: string; | ||
| settings?: Record<string, any> | undefined; | ||
| parameters?: Record<string, any> | undefined; | ||
| cron?: string | undefined; | ||
| dateTime?: string | undefined; | ||
| }>; | ||
| export declare const processesToolNames: { | ||
| readonly getProcesses: "get_processes"; | ||
| readonly createProcess: "create_process"; | ||
| readonly getProcess: "get_process"; | ||
| readonly deleteProcess: "delete_process"; | ||
| readonly getProcessVersions: "get_process_versions"; | ||
| readonly executeProcessAsync: "execute_process_async"; | ||
| readonly executeProcessSync: "execute_process_sync"; | ||
| readonly scheduleProcess: "schedule_process"; | ||
| }; | ||
| export declare const processesToolDefinitions: ({ | ||
| name: "get_processes"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| keywords: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| tags: { | ||
| type: string; | ||
| items: { | ||
| type: string; | ||
| }; | ||
| description: string; | ||
| }; | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| settings?: undefined; | ||
| identifier?: undefined; | ||
| processId?: undefined; | ||
| parameters?: undefined; | ||
| initiatedBy?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required?: undefined; | ||
| }; | ||
| } | { | ||
| name: "create_process"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| name: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| slug: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| description: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| readme: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| programmingLanguage: { | ||
| type: string; | ||
| enum: string[]; | ||
| description: string; | ||
| }; | ||
| sourceCode: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| parametersSchema: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| webhook: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| manifest: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| settings: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| tags: { | ||
| type: string; | ||
| items: { | ||
| type: string; | ||
| }; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| identifier?: undefined; | ||
| processId?: undefined; | ||
| parameters?: undefined; | ||
| initiatedBy?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_process"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| identifier: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| tags?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| settings?: undefined; | ||
| processId?: undefined; | ||
| parameters?: undefined; | ||
| initiatedBy?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "delete_process"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| identifier: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| tags?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| settings?: undefined; | ||
| processId?: undefined; | ||
| parameters?: undefined; | ||
| initiatedBy?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "get_process_versions"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| processId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| tags?: undefined; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| settings?: undefined; | ||
| identifier?: undefined; | ||
| parameters?: undefined; | ||
| initiatedBy?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "execute_process_async"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| identifier: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| parameters: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| initiatedBy: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| settings: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| tags?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| processId?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "execute_process_sync"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| identifier: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| parameters: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| initiatedBy: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| settings: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| tags?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| processId?: undefined; | ||
| type?: undefined; | ||
| cron?: undefined; | ||
| dateTime?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "schedule_process"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| identifier: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| parameters: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| type: { | ||
| type: string; | ||
| enum: string[]; | ||
| description: string; | ||
| }; | ||
| cron: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| dateTime: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| settings: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords?: undefined; | ||
| tags?: undefined; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| name?: undefined; | ||
| slug?: undefined; | ||
| description?: undefined; | ||
| readme?: undefined; | ||
| programmingLanguage?: undefined; | ||
| sourceCode?: undefined; | ||
| parametersSchema?: undefined; | ||
| webhook?: undefined; | ||
| manifest?: undefined; | ||
| processId?: undefined; | ||
| initiatedBy?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| })[]; |
| import { z } from "zod"; | ||
| // Schema for getting processes with pagination and filtering | ||
| export const GetProcessesSchema = z.object({ | ||
| keywords: z | ||
| .string() | ||
| .optional() | ||
| .describe("Search keywords that apply to process name or description (case-insensitive)"), | ||
| tags: z | ||
| .array(z.string()) | ||
| .optional() | ||
| .describe("Filter processes by tags (array of tag names)"), | ||
| page: z | ||
| .number() | ||
| .int() | ||
| .min(0) | ||
| .default(0) | ||
| .optional() | ||
| .describe("Page number for pagination (0-based index)"), | ||
| limit: z | ||
| .number() | ||
| .int() | ||
| .min(1) | ||
| .max(100) | ||
| .default(10) | ||
| .optional() | ||
| .describe("Maximum number of processes to retrieve per page"), | ||
| }); | ||
| // Schema for creating a process | ||
| export const CreateProcessSchema = z.object({ | ||
| name: z | ||
| .string() | ||
| .describe("The name of the process. This will be displayed in the UI and used for identification."), | ||
| slug: z | ||
| .string() | ||
| .optional() | ||
| .describe("A unique identifier for the process. Used in URLs and API calls. Must be URL-safe (lowercase, hyphens, no spaces)."), | ||
| description: z | ||
| .string() | ||
| .optional() | ||
| .describe("A detailed description of what the process does. This helps users understand the process purpose and functionality."), | ||
| readme: z | ||
| .string() | ||
| .optional() | ||
| .describe("Markdown documentation for the process. This can include usage instructions, examples, and additional context."), | ||
| programmingLanguage: z | ||
| .enum(["JAVASCRIPT", "PYTHON"]) | ||
| .describe("The programming language used for the process source code. Supported languages are JAVASCRIPT and PYTHON."), | ||
| sourceCode: z | ||
| .string() | ||
| .describe("The source code of the process. This is the executable code that will run when the process is executed."), | ||
| parametersSchema: z | ||
| .string() | ||
| .optional() | ||
| .describe("JSON Schema defining the input parameters for the process. This schema is used to generate forms in the UI and validate input data."), | ||
| webhook: z | ||
| .record(z.any()) | ||
| .optional() | ||
| .describe("Webhook configuration for the process. Defines how the process can be triggered via HTTP webhooks."), | ||
| manifest: z | ||
| .record(z.any()) | ||
| .optional() | ||
| .describe("Process manifest configuration. Contains metadata and configuration for the process deployment and execution."), | ||
| settings: z | ||
| .record(z.any()) | ||
| .optional() | ||
| .describe("Process settings and configuration options. Includes publication settings, form configurations, and dependencies."), | ||
| tags: z | ||
| .array(z.string()) | ||
| .optional() | ||
| .describe("Tags for categorizing and organizing processes. Used for filtering and grouping in the UI."), | ||
| }); | ||
| // Schema for getting a specific process | ||
| export const GetProcessSchema = z.object({ | ||
| identifier: z | ||
| .string() | ||
| .describe("Unique identifier of the process to retrieve (UUID or slug)"), | ||
| }); | ||
| // Schema for deleting a process | ||
| export const DeleteProcessSchema = z.object({ | ||
| identifier: z | ||
| .string() | ||
| .describe("Unique identifier of the process to delete (UUID or slug)"), | ||
| }); | ||
| // Schema for getting process versions | ||
| export const GetProcessVersionsSchema = z.object({ | ||
| processId: z.string().describe("Process ID"), | ||
| page: z.number().int().min(0).default(0).optional().describe("Page number"), | ||
| limit: z | ||
| .number() | ||
| .int() | ||
| .min(1) | ||
| .max(100) | ||
| .default(10) | ||
| .optional() | ||
| .describe("Amount of items to retrieve"), | ||
| }); | ||
| // Schema for executing a process asynchronously | ||
| export const ExecuteProcessAsyncSchema = z.object({ | ||
| identifier: z | ||
| .string() | ||
| .describe("Unique identifier of the process to execute asynchronously (UUID or slug)"), | ||
| parameters: z.record(z.any()).optional().describe("Process parameters"), | ||
| initiatedBy: z | ||
| .string() | ||
| .optional() | ||
| .describe("An identifier for the individual initiating the request"), | ||
| settings: z.record(z.any()).optional().describe("Execution settings"), | ||
| }); | ||
| // Schema for executing a process synchronously | ||
| export const ExecuteProcessSyncSchema = z.object({ | ||
| identifier: z | ||
| .string() | ||
| .describe("Unique identifier of the process to execute synchronously (UUID or slug)"), | ||
| parameters: z.record(z.any()).optional().describe("Process parameters"), | ||
| initiatedBy: z | ||
| .string() | ||
| .optional() | ||
| .describe("An identifier for the individual initiating the request"), | ||
| settings: z.record(z.any()).optional().describe("Execution settings"), | ||
| }); | ||
| // Schema for scheduling a process | ||
| export const ScheduleProcessSchema = z.object({ | ||
| identifier: z | ||
| .string() | ||
| .describe("Unique identifier of the process to schedule (UUID or slug)"), | ||
| parameters: z.record(z.any()).optional().describe("Process parameters"), | ||
| type: z.enum(["PERIODIC", "ONCE"]).describe("Schedule type"), | ||
| cron: z | ||
| .string() | ||
| .optional() | ||
| .describe("Cron expression for PERIODIC schedules"), | ||
| dateTime: z | ||
| .string() | ||
| .optional() | ||
| .describe("Date and time for ONCE schedules (ISO format)"), | ||
| settings: z.record(z.any()).optional().describe("Schedule settings"), | ||
| }); | ||
| // Tool names | ||
| export const processesToolNames = { | ||
| getProcesses: "get_processes", | ||
| createProcess: "create_process", | ||
| getProcess: "get_process", | ||
| deleteProcess: "delete_process", | ||
| getProcessVersions: "get_process_versions", | ||
| executeProcessAsync: "execute_process_async", | ||
| executeProcessSync: "execute_process_sync", | ||
| scheduleProcess: "schedule_process", | ||
| }; | ||
| // Tool definitions | ||
| export const processesToolDefinitions = [ | ||
| { | ||
| name: processesToolNames.getProcesses, | ||
| title: "Get Processes", | ||
| description: "Retrieves a paginated list of processes with optional filtering by keywords and tags. Processes are executable code units that can be scheduled or triggered manually.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| keywords: { | ||
| type: "string", | ||
| description: "Search keywords that apply to process name or description (case-insensitive)", | ||
| }, | ||
| tags: { | ||
| type: "array", | ||
| items: { type: "string" }, | ||
| description: "Filter processes by tags (array of tag names)", | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number for pagination (0-based index)", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Maximum number of processes to retrieve per page", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.createProcess, | ||
| title: "Create Process", | ||
| description: "Creates a new process with source code, configuration, and metadata. The process can be written in JavaScript or Python and includes parameter schemas for form generation.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| name: { | ||
| type: "string", | ||
| description: "The name of the process. This will be displayed in the UI and used for identification.", | ||
| }, | ||
| slug: { | ||
| type: "string", | ||
| description: "A unique identifier for the process. Used in URLs and API calls. Must be URL-safe (lowercase, hyphens, no spaces).", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| description: "A detailed description of what the process does. This helps users understand the process purpose and functionality.", | ||
| }, | ||
| readme: { | ||
| type: "string", | ||
| description: "Markdown documentation for the process. This can include usage instructions, examples, and additional context.", | ||
| }, | ||
| programmingLanguage: { | ||
| type: "string", | ||
| enum: ["JAVASCRIPT", "PYTHON"], | ||
| description: "The programming language used for the process source code. Supported languages are JAVASCRIPT and PYTHON.", | ||
| }, | ||
| sourceCode: { | ||
| type: "string", | ||
| description: "The source code of the process. This is the executable code that will run when the process is executed.", | ||
| }, | ||
| parametersSchema: { | ||
| type: "string", | ||
| description: "JSON Schema defining the input parameters for the process. This schema is used to generate forms in the UI and validate input data.", | ||
| }, | ||
| webhook: { | ||
| type: "object", | ||
| description: "Webhook configuration for the process. Defines how the process can be triggered via HTTP webhooks.", | ||
| }, | ||
| manifest: { | ||
| type: "object", | ||
| description: "Process manifest configuration. Contains metadata and configuration for the process deployment and execution.", | ||
| }, | ||
| settings: { | ||
| type: "object", | ||
| description: "Process settings and configuration options. Includes publication settings, form configurations, and dependencies.", | ||
| }, | ||
| tags: { | ||
| type: "array", | ||
| items: { type: "string" }, | ||
| description: "Tags for categorizing and organizing processes. Used for filtering and grouping in the UI.", | ||
| }, | ||
| }, | ||
| required: ["name", "programmingLanguage", "sourceCode"], | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.getProcess, | ||
| title: "Get Process", | ||
| description: "Retrieves detailed information about a specific process including its configuration, source code, and metadata.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| identifier: { | ||
| type: "string", | ||
| description: "Unique identifier of the process to retrieve (UUID or slug)", | ||
| }, | ||
| }, | ||
| required: ["identifier"], | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.deleteProcess, | ||
| title: "Delete Process", | ||
| description: "Deletes a process and all its versions. This action cannot be undone.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| identifier: { | ||
| type: "string", | ||
| description: "Unique identifier of the process to delete (UUID or slug)", | ||
| }, | ||
| }, | ||
| required: ["identifier"], | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.getProcessVersions, | ||
| title: "Get Process Versions", | ||
| description: "Retrieves a paginated list of versions for a specific process.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| processId: { | ||
| type: "string", | ||
| description: "Process ID", | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Amount of items to retrieve", | ||
| }, | ||
| }, | ||
| required: ["processId"], | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.executeProcessAsync, | ||
| title: "Execute Process Async", | ||
| description: "Executes a process asynchronously and returns an execution ID for tracking.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| identifier: { | ||
| type: "string", | ||
| description: "Unique identifier of the process to execute asynchronously (UUID or slug)", | ||
| }, | ||
| parameters: { | ||
| type: "object", | ||
| description: "Process parameters", | ||
| }, | ||
| initiatedBy: { | ||
| type: "string", | ||
| description: "An identifier for the individual initiating the request", | ||
| }, | ||
| settings: { | ||
| type: "object", | ||
| description: "Execution settings", | ||
| }, | ||
| }, | ||
| required: ["identifier"], | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.executeProcessSync, | ||
| title: "Execute Process Sync", | ||
| description: "Executes a process synchronously and waits for completion.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| identifier: { | ||
| type: "string", | ||
| description: "Unique identifier of the process to execute synchronously (UUID or slug)", | ||
| }, | ||
| parameters: { | ||
| type: "object", | ||
| description: "Process parameters", | ||
| }, | ||
| initiatedBy: { | ||
| type: "string", | ||
| description: "An identifier for the individual initiating the request", | ||
| }, | ||
| settings: { | ||
| type: "object", | ||
| description: "Execution settings", | ||
| }, | ||
| }, | ||
| required: ["identifier"], | ||
| }, | ||
| }, | ||
| { | ||
| name: processesToolNames.scheduleProcess, | ||
| title: "Schedule Process", | ||
| description: "Creates a schedule for a process to run automatically at specified times.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| identifier: { | ||
| type: "string", | ||
| description: "Unique identifier of the process to schedule (UUID or slug)", | ||
| }, | ||
| parameters: { | ||
| type: "object", | ||
| description: "Process parameters", | ||
| }, | ||
| type: { | ||
| type: "string", | ||
| enum: ["PERIODIC", "ONCE"], | ||
| description: "Schedule type", | ||
| }, | ||
| cron: { | ||
| type: "string", | ||
| description: "Cron expression for PERIODIC schedules", | ||
| }, | ||
| dateTime: { | ||
| type: "string", | ||
| description: "Date and time for ONCE schedules (ISO format)", | ||
| }, | ||
| settings: { | ||
| type: "object", | ||
| description: "Schedule settings", | ||
| }, | ||
| }, | ||
| required: ["identifier", "type"], | ||
| }, | ||
| }, | ||
| ]; |
| import { z } from "zod"; | ||
| export declare const GetSchedulesSchema: z.ZodObject<{ | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| processId: z.ZodOptional<z.ZodString>; | ||
| keywords: z.ZodOptional<z.ZodString>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| processId?: string | undefined; | ||
| keywords?: string | undefined; | ||
| }, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| processId?: string | undefined; | ||
| keywords?: string | undefined; | ||
| }>; | ||
| export declare const GetScheduleSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const PauseScheduleSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const ResumeScheduleSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const DeleteScheduleSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const schedulesToolNames: { | ||
| readonly getSchedules: "get_schedules"; | ||
| readonly getSchedule: "get_schedule"; | ||
| readonly pauseSchedule: "pause_schedule"; | ||
| readonly resumeSchedule: "resume_schedule"; | ||
| readonly deleteSchedule: "delete_schedule"; | ||
| }; | ||
| export declare const schedulesToolDefinitions: ({ | ||
| name: "get_schedules"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| processId: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| keywords: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| id?: undefined; | ||
| }; | ||
| required?: undefined; | ||
| }; | ||
| } | { | ||
| name: "get_schedule"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| processId?: undefined; | ||
| keywords?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "pause_schedule"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| processId?: undefined; | ||
| keywords?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "resume_schedule"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| processId?: undefined; | ||
| keywords?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "delete_schedule"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| processId?: undefined; | ||
| keywords?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| })[]; |
| import { z } from "zod"; | ||
| // Schema for getting schedules with pagination and filtering | ||
| export const GetSchedulesSchema = z.object({ | ||
| page: z | ||
| .number() | ||
| .int() | ||
| .min(0) | ||
| .default(0) | ||
| .optional() | ||
| .describe("Page number for pagination (0-based index)"), | ||
| limit: z | ||
| .number() | ||
| .int() | ||
| .min(1) | ||
| .max(100) | ||
| .default(10) | ||
| .optional() | ||
| .describe("Maximum number of scheduled processes to retrieve per page"), | ||
| processId: z | ||
| .string() | ||
| .optional() | ||
| .describe("Filter scheduled processes by process ID (UUID)"), | ||
| keywords: z | ||
| .string() | ||
| .optional() | ||
| .describe("Keywords filter: applies to process name or schedule comment"), | ||
| }); | ||
| // Schema for getting a specific schedule | ||
| export const GetScheduleSchema = z.object({ | ||
| id: z | ||
| .string() | ||
| .describe("Unique identifier (UUID) of the scheduled process to retrieve"), | ||
| }); | ||
| // Schema for pausing a schedule | ||
| export const PauseScheduleSchema = z.object({ | ||
| id: z | ||
| .string() | ||
| .describe("Unique identifier (UUID) of the scheduled process to pause"), | ||
| }); | ||
| // Schema for resuming a schedule | ||
| export const ResumeScheduleSchema = z.object({ | ||
| id: z | ||
| .string() | ||
| .describe("Unique identifier (UUID) of the scheduled process to resume"), | ||
| }); | ||
| // Schema for deleting a schedule | ||
| export const DeleteScheduleSchema = z.object({ | ||
| id: z | ||
| .string() | ||
| .describe("Unique identifier (UUID) of the scheduled process to delete"), | ||
| }); | ||
| // Tool names | ||
| export const schedulesToolNames = { | ||
| getSchedules: "get_schedules", | ||
| getSchedule: "get_schedule", | ||
| pauseSchedule: "pause_schedule", | ||
| resumeSchedule: "resume_schedule", | ||
| deleteSchedule: "delete_schedule", | ||
| }; | ||
| // Tool definitions | ||
| export const schedulesToolDefinitions = [ | ||
| { | ||
| name: schedulesToolNames.getSchedules, | ||
| title: "Get Scheduled Processes", | ||
| description: "Retrieves a paginated list of scheduled processes with optional filtering by process and keywords. Scheduled processes define when and how often processes should be executed automatically.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number for pagination (0-based index)", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Maximum number of scheduled processes to retrieve per page", | ||
| }, | ||
| processId: { | ||
| type: "string", | ||
| description: "Filter scheduled processes by process ID (UUID)", | ||
| }, | ||
| keywords: { | ||
| type: "string", | ||
| description: "Keywords filter: applies to process name or schedule comment", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: schedulesToolNames.getSchedule, | ||
| title: "Get Scheduled Process", | ||
| description: "Retrieves detailed information about a specific scheduled process including its configuration, schedule settings, and current status.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the scheduled process to retrieve", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: schedulesToolNames.pauseSchedule, | ||
| title: "Pause Scheduled Process", | ||
| description: "Pauses a currently active scheduled process. The process will stop executing until it is resumed.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the scheduled process to pause", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: schedulesToolNames.resumeSchedule, | ||
| title: "Resume Scheduled Process", | ||
| description: "Resumes a previously paused scheduled process. The process will continue executing according to its original schedule configuration.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the scheduled process to resume", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: schedulesToolNames.deleteSchedule, | ||
| title: "Delete Scheduled Process", | ||
| description: "Permanently deletes a scheduled process and cancels all future executions. This action cannot be undone.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the scheduled process to delete", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| ]; |
| import { z } from "zod"; | ||
| export declare const GetVariablesSchema: z.ZodObject<{ | ||
| page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }, { | ||
| page?: number | undefined; | ||
| limit?: number | undefined; | ||
| }>; | ||
| export declare const CreateVariableSchema: z.ZodObject<{ | ||
| key: z.ZodString; | ||
| value: z.ZodString; | ||
| isSensitive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| value: string; | ||
| key: string; | ||
| isSensitive: boolean; | ||
| }, { | ||
| value: string; | ||
| key: string; | ||
| isSensitive?: boolean | undefined; | ||
| }>; | ||
| export declare const UpdateVariableSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| value: z.ZodOptional<z.ZodString>; | ||
| isSensitive: z.ZodOptional<z.ZodBoolean>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| value?: string | undefined; | ||
| isSensitive?: boolean | undefined; | ||
| }, { | ||
| id: string; | ||
| value?: string | undefined; | ||
| isSensitive?: boolean | undefined; | ||
| }>; | ||
| export declare const DeleteVariableSchema: z.ZodObject<{ | ||
| id: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| id: string; | ||
| }, { | ||
| id: string; | ||
| }>; | ||
| export declare const variablesToolNames: { | ||
| readonly getVariables: "get_variables"; | ||
| readonly createVariable: "create_variable"; | ||
| readonly updateVariable: "update_variable"; | ||
| readonly deleteVariable: "delete_variable"; | ||
| }; | ||
| export declare const variablesToolDefinitions: ({ | ||
| name: "get_variables"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| page: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| limit: { | ||
| type: string; | ||
| format: string; | ||
| default: number; | ||
| description: string; | ||
| }; | ||
| key?: undefined; | ||
| value?: undefined; | ||
| isSensitive?: undefined; | ||
| id?: undefined; | ||
| }; | ||
| required?: undefined; | ||
| }; | ||
| } | { | ||
| name: "create_variable"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| key: { | ||
| type: string; | ||
| minLength: number; | ||
| maxLength: number; | ||
| pattern: string; | ||
| description: string; | ||
| }; | ||
| value: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| isSensitive: { | ||
| type: string; | ||
| default: boolean; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| id?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "update_variable"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| value: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| isSensitive: { | ||
| type: string; | ||
| description: string; | ||
| default?: undefined; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| key?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "delete_variable"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| id: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| page?: undefined; | ||
| limit?: undefined; | ||
| key?: undefined; | ||
| value?: undefined; | ||
| isSensitive?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| })[]; |
| import { z } from "zod"; | ||
| // Schema for getting variables with pagination | ||
| export const GetVariablesSchema = z.object({ | ||
| page: z | ||
| .number() | ||
| .int() | ||
| .min(0) | ||
| .default(0) | ||
| .optional() | ||
| .describe("Page number for pagination (0-based index)"), | ||
| limit: z | ||
| .number() | ||
| .int() | ||
| .min(1) | ||
| .max(100) | ||
| .default(10) | ||
| .optional() | ||
| .describe("Maximum number of variables to retrieve per page"), | ||
| }); | ||
| // Schema for creating a variable | ||
| export const CreateVariableSchema = z.object({ | ||
| key: z | ||
| .string() | ||
| .min(1) | ||
| .max(255) | ||
| .regex(/^[a-zA-Z][a-zA-Z0-9_]*$/) | ||
| .describe("Variable key (must start with letter, contain only letters, numbers, and underscores)"), | ||
| value: z.string().describe("Variable value"), | ||
| isSensitive: z | ||
| .boolean() | ||
| .optional() | ||
| .default(true) | ||
| .describe("Whether the variable is sensitive (hidden in logs and UI)"), | ||
| }); | ||
| // Schema for updating a variable | ||
| export const UpdateVariableSchema = z.object({ | ||
| id: z | ||
| .string() | ||
| .describe("Unique identifier (UUID) of the team variable to update"), | ||
| value: z.string().optional().describe("New variable value"), | ||
| isSensitive: z | ||
| .boolean() | ||
| .optional() | ||
| .describe("Whether the variable is sensitive (hidden in logs and UI)"), | ||
| }); | ||
| // Schema for deleting a variable | ||
| export const DeleteVariableSchema = z.object({ | ||
| id: z | ||
| .string() | ||
| .describe("Unique identifier (UUID) of the team variable to delete"), | ||
| }); | ||
| // Tool names | ||
| export const variablesToolNames = { | ||
| getVariables: "get_variables", | ||
| createVariable: "create_variable", | ||
| updateVariable: "update_variable", | ||
| deleteVariable: "delete_variable", | ||
| }; | ||
| // Tool definitions | ||
| export const variablesToolDefinitions = [ | ||
| { | ||
| name: variablesToolNames.getVariables, | ||
| title: "Get Variables", | ||
| description: "Retrieves a paginated list of team variables. Variables are key-value pairs that can be used across processes and executions.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| page: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 0, | ||
| description: "Page number for pagination (0-based index)", | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| format: "int32", | ||
| default: 10, | ||
| description: "Maximum number of variables to retrieve per page", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: variablesToolNames.createVariable, | ||
| title: "Create Variable", | ||
| description: "Creates a new team variable that can be used across processes and executions. Variables can be marked as sensitive to hide their values in logs and UI.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| key: { | ||
| type: "string", | ||
| minLength: 1, | ||
| maxLength: 255, | ||
| pattern: "^[a-zA-Z][a-zA-Z0-9_]*$", | ||
| description: "Variable key (must start with letter, contain only letters, numbers, and underscores)", | ||
| }, | ||
| value: { | ||
| type: "string", | ||
| description: "Variable value", | ||
| }, | ||
| isSensitive: { | ||
| type: "boolean", | ||
| default: true, | ||
| description: "Whether the variable is sensitive (hidden in logs and UI)", | ||
| }, | ||
| }, | ||
| required: ["key", "value"], | ||
| }, | ||
| }, | ||
| { | ||
| name: variablesToolNames.updateVariable, | ||
| title: "Update Variable", | ||
| description: "Updates an existing team variable with new value or configuration. Sensitive variables will have their values hidden in logs and UI.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the team variable to update", | ||
| }, | ||
| value: { | ||
| type: "string", | ||
| description: "New variable value", | ||
| }, | ||
| isSensitive: { | ||
| type: "boolean", | ||
| description: "Whether the variable is sensitive (hidden in logs and UI)", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| { | ||
| name: variablesToolNames.deleteVariable, | ||
| title: "Delete Variable", | ||
| description: "Permanently deletes a team variable. This action cannot be undone and may affect processes that depend on this variable.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| id: { | ||
| type: "string", | ||
| description: "Unique identifier (UUID) of the team variable to delete", | ||
| }, | ||
| }, | ||
| required: ["id"], | ||
| }, | ||
| }, | ||
| ]; |
+237
-46
@@ -8,19 +8,14 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js"; | ||
| import Logger from "./logger.js"; | ||
| import { DeleteObjectSchema, DownloadObjectSchema, ListObjectsSchema, storageToolDefinitions, storageToolNames, UploadObjectSchema, } from "./tools/storage-tool-definitions.js"; | ||
| import { SetEnvVarSchema, RemoveEnvVarSchema, envVarsToolDefinitions, envVarsToolNames, } from "./tools/env-vars-tool-definitions.js"; | ||
| import { GetExecutionSchema, getExecutionToolNames, getExecutionToolDefinitions, } from "./tools/get-execution-tool-definition.js"; | ||
| import { GetStorageObjectsSchema, UploadStorageObjectSchema, DownloadStorageObjectSchema, DeleteStorageObjectSchema, storageToolDefinitions, storageToolNames, } from "./tools/storage-tool-definitions.js"; | ||
| import { GetVariablesSchema, CreateVariableSchema, UpdateVariableSchema, DeleteVariableSchema, variablesToolDefinitions, variablesToolNames, } from "./tools/variables-tool-definitions.js"; | ||
| import { runCodeToolDefinitions, RunCodeSchema, RunProcessSchema, runCodeToolNames, } from "./tools/run-code-tool-definitinos.js"; | ||
| const RUN_PROCESS_TOOL_NAME_PREFIX = "run_ycp_"; | ||
| import { GetSchedulesSchema, GetScheduleSchema, PauseScheduleSchema, ResumeScheduleSchema, DeleteScheduleSchema, schedulesToolDefinitions, schedulesToolNames, } from "./tools/schedules-tool-definitions.js"; | ||
| import { GetProcessesSchema, CreateProcessSchema, GetProcessSchema, DeleteProcessSchema, GetProcessVersionsSchema, ExecuteProcessAsyncSchema, ExecuteProcessSyncSchema, ScheduleProcessSchema, processesToolDefinitions, processesToolNames, } from "./tools/processes-tool-definitions.js"; | ||
| import { GetExecutionsSchema, GetExecutionSchema, KillExecutionSchema, RerunExecutionSchema, GetExecutionLogsSchema, executionsToolDefinitions, executionsToolNames, } from "./tools/executions-tool-definitions.js"; | ||
| import { GetModulesSchema, CreateModuleSchema, GetModuleSchema, DeleteModuleSchema, GetModuleVersionsSchema, GetModuleVersionSchema, DeleteModuleVersionSchema, GetModuleAliasesSchema, modulesToolDefinitions, modulesToolNames, } from "./tools/modules-tool-definitions.js"; | ||
| const RUN_PROCESS_TOOL_NAME_PREFIX = "yc_"; | ||
| const RUN_PROCESS_TOOL_TAG = "mcp-tool"; | ||
| const RUN_CODE_TOOL_TAG = "run_code"; | ||
| const EXECUTIONS_TOOL_TAG = "executions"; | ||
| const ENV_VARS_TOOL_TAG = "env_vars"; | ||
| const STORAGE_TOOL_TAG = "storage"; | ||
| const DEFAULT_TOOL_TAGS = [ | ||
| RUN_CODE_TOOL_TAG, | ||
| EXECUTIONS_TOOL_TAG, | ||
| ENV_VARS_TOOL_TAG, | ||
| STORAGE_TOOL_TAG, | ||
| RUN_PROCESS_TOOL_TAG, | ||
| ]; | ||
| const API_TOOL_TAG = "yc_api"; | ||
| const DEFAULT_TOOL_TAGS = [RUN_CODE_TOOL_TAG, RUN_PROCESS_TOOL_TAG]; | ||
| dotenv.config(); | ||
@@ -139,11 +134,10 @@ class YepCodeMcpServer extends Server { | ||
| const tools = []; | ||
| if (this.tools.includes(EXECUTIONS_TOOL_TAG)) { | ||
| tools.push(...getExecutionToolDefinitions); | ||
| } | ||
| if (this.tools.includes(STORAGE_TOOL_TAG)) { | ||
| if (this.tools.includes(API_TOOL_TAG)) { | ||
| tools.push(...storageToolDefinitions); | ||
| tools.push(...variablesToolDefinitions); | ||
| tools.push(...schedulesToolDefinitions); | ||
| tools.push(...processesToolDefinitions); | ||
| tools.push(...executionsToolDefinitions); | ||
| tools.push(...modulesToolDefinitions); | ||
| } | ||
| if (this.tools.includes(ENV_VARS_TOOL_TAG)) { | ||
| tools.push(...envVarsToolDefinitions); | ||
| } | ||
| if (this.tools.includes(RUN_CODE_TOOL_TAG)) { | ||
@@ -173,3 +167,3 @@ const envVars = await this.yepCodeEnv.getEnvVars(); | ||
| } | ||
| let toolName = `${RUN_PROCESS_TOOL_NAME_PREFIX}${process.slug}`; | ||
| let toolName = process.slug; | ||
| if (toolName.length > 60) { | ||
@@ -255,30 +249,45 @@ toolName = `${RUN_PROCESS_TOOL_NAME_PREFIX}${process.id}`; | ||
| }); | ||
| case envVarsToolNames.set: | ||
| return this.handleToolRequest(SetEnvVarSchema, request, async (data) => { | ||
| const { key, value, isSensitive } = data; | ||
| this.logger.info(`Setting environment variable: ${key}`, { | ||
| isSensitive, | ||
| case variablesToolNames.getVariables: | ||
| return this.handleToolRequest(GetVariablesSchema, request, async (data) => { | ||
| const variables = await this.yepCodeApi.getVariables({ | ||
| page: data.page, | ||
| limit: data.limit, | ||
| }); | ||
| await this.yepCodeEnv.setEnvVar(key, value, isSensitive); | ||
| return {}; | ||
| return variables; | ||
| }); | ||
| case envVarsToolNames.remove: | ||
| return this.handleToolRequest(RemoveEnvVarSchema, request, async (data) => { | ||
| this.logger.info(`Removing environment variable: ${data.key}`); | ||
| await this.yepCodeEnv.delEnvVar(data.key); | ||
| return {}; | ||
| case variablesToolNames.createVariable: | ||
| return this.handleToolRequest(CreateVariableSchema, request, async (data) => { | ||
| const variable = await this.yepCodeApi.createVariable({ | ||
| key: data.key, | ||
| value: data.value, | ||
| isSensitive: data.isSensitive, | ||
| }); | ||
| return variable; | ||
| }); | ||
| case getExecutionToolNames.getExecution: | ||
| return this.handleToolRequest(GetExecutionSchema, request, async (data) => { | ||
| return await this.executionResult(data.executionId); | ||
| case variablesToolNames.updateVariable: | ||
| return this.handleToolRequest(UpdateVariableSchema, request, async (data) => { | ||
| const updateData = {}; | ||
| if (data.value !== undefined) { | ||
| updateData.value = data.value; | ||
| } | ||
| if (data.isSensitive !== undefined) { | ||
| updateData.isSensitive = data.isSensitive; | ||
| } | ||
| const variable = await this.yepCodeApi.updateVariable(data.id, updateData); | ||
| return variable; | ||
| }); | ||
| case storageToolNames.list: | ||
| return this.handleToolRequest(ListObjectsSchema, request, async (data) => { | ||
| case variablesToolNames.deleteVariable: | ||
| return this.handleToolRequest(DeleteVariableSchema, request, async (data) => { | ||
| await this.yepCodeApi.deleteVariable(data.id); | ||
| return { result: `Variable ${data.id} deleted successfully` }; | ||
| }); | ||
| case storageToolNames.getStorageObjects: | ||
| return this.handleToolRequest(GetStorageObjectsSchema, request, async (data) => { | ||
| const objects = await this.yepCodeApi.getObjects({ | ||
| prefix: data?.prefix || undefined, | ||
| prefix: data.prefix, | ||
| }); | ||
| return objects; | ||
| }); | ||
| case storageToolNames.upload: | ||
| return this.handleToolRequest(UploadObjectSchema, request, async (data) => { | ||
| case storageToolNames.uploadStorageObject: | ||
| return this.handleToolRequest(UploadStorageObjectSchema, request, async (data) => { | ||
| const { filename, content } = data; | ||
@@ -301,4 +310,4 @@ let fileContent; | ||
| }); | ||
| case storageToolNames.download: | ||
| return this.handleToolRequest(DownloadObjectSchema, request, async (data) => { | ||
| case storageToolNames.downloadStorageObject: | ||
| return this.handleToolRequest(DownloadStorageObjectSchema, request, async (data) => { | ||
| const { filename } = data; | ||
@@ -318,4 +327,4 @@ const stream = await this.yepCodeApi.getObject(filename); | ||
| }); | ||
| case storageToolNames.delete: | ||
| return this.handleToolRequest(DeleteObjectSchema, request, async (data) => { | ||
| case storageToolNames.deleteStorageObject: | ||
| return this.handleToolRequest(DeleteStorageObjectSchema, request, async (data) => { | ||
| const { filename } = data; | ||
@@ -325,2 +334,184 @@ await this.yepCodeApi.deleteObject(filename); | ||
| }); | ||
| case schedulesToolNames.getSchedules: | ||
| return this.handleToolRequest(GetSchedulesSchema, request, async (data) => { | ||
| const schedules = await this.yepCodeApi.getSchedules({ | ||
| page: data.page, | ||
| limit: data.limit, | ||
| processId: data.processId, | ||
| keywords: data.keywords, | ||
| }); | ||
| return schedules; | ||
| }); | ||
| case schedulesToolNames.getSchedule: | ||
| return this.handleToolRequest(GetScheduleSchema, request, async (data) => { | ||
| const schedule = await this.yepCodeApi.getSchedule(data.id); | ||
| return schedule; | ||
| }); | ||
| case schedulesToolNames.pauseSchedule: | ||
| return this.handleToolRequest(PauseScheduleSchema, request, async (data) => { | ||
| await this.yepCodeApi.pauseSchedule(data.id); | ||
| return { result: `Schedule ${data.id} paused successfully` }; | ||
| }); | ||
| case schedulesToolNames.resumeSchedule: | ||
| return this.handleToolRequest(ResumeScheduleSchema, request, async (data) => { | ||
| await this.yepCodeApi.resumeSchedule(data.id); | ||
| return { result: `Schedule ${data.id} resumed successfully` }; | ||
| }); | ||
| case schedulesToolNames.deleteSchedule: | ||
| return this.handleToolRequest(DeleteScheduleSchema, request, async (data) => { | ||
| await this.yepCodeApi.deleteSchedule(data.id); | ||
| return { result: `Schedule ${data.id} deleted successfully` }; | ||
| }); | ||
| case processesToolNames.getProcesses: | ||
| return this.handleToolRequest(GetProcessesSchema, request, async (data) => { | ||
| const processes = await this.yepCodeApi.getProcesses({ | ||
| keywords: data.keywords, | ||
| tags: data.tags, | ||
| page: data.page, | ||
| limit: data.limit, | ||
| }); | ||
| return processes; | ||
| }); | ||
| case processesToolNames.createProcess: | ||
| return this.handleToolRequest(CreateProcessSchema, request, async (data) => { | ||
| const process = await this.yepCodeApi.createProcess({ | ||
| name: data.name, | ||
| description: data.description, | ||
| slug: data.slug, | ||
| readme: data.readme, | ||
| programmingLanguage: data.programmingLanguage, | ||
| sourceCode: data.sourceCode, | ||
| parametersSchema: data.parametersSchema, | ||
| webhook: data.webhook, | ||
| manifest: data.manifest, | ||
| tags: data.tags, | ||
| settings: data.settings, | ||
| }); | ||
| return process; | ||
| }); | ||
| case processesToolNames.getProcess: | ||
| return this.handleToolRequest(GetProcessSchema, request, async (data) => { | ||
| const process = await this.yepCodeApi.getProcess(data.identifier); | ||
| return process; | ||
| }); | ||
| case processesToolNames.deleteProcess: | ||
| return this.handleToolRequest(DeleteProcessSchema, request, async (data) => { | ||
| await this.yepCodeApi.deleteProcess(data.identifier); | ||
| return { | ||
| result: `Process ${data.identifier} deleted successfully`, | ||
| }; | ||
| }); | ||
| case processesToolNames.getProcessVersions: | ||
| return this.handleToolRequest(GetProcessVersionsSchema, request, async (data) => { | ||
| const versions = await this.yepCodeApi.getProcessVersions(data.processId, { | ||
| page: data.page, | ||
| limit: data.limit, | ||
| }); | ||
| return versions; | ||
| }); | ||
| case processesToolNames.executeProcessAsync: | ||
| return this.handleToolRequest(ExecuteProcessAsyncSchema, request, async (data) => { | ||
| const { executionId } = await this.yepCodeApi.executeProcessAsync(data.identifier, data.parameters, { | ||
| initiatedBy: data.initiatedBy || "@yepcode/mcp-server", | ||
| ...data.settings, | ||
| }); | ||
| return { executionId }; | ||
| }); | ||
| case processesToolNames.executeProcessSync: | ||
| return this.handleToolRequest(ExecuteProcessSyncSchema, request, async (data) => { | ||
| const result = await this.yepCodeApi.executeProcessSync(data.identifier, data.parameters, { | ||
| initiatedBy: data.initiatedBy || "@yepcode/mcp-server", | ||
| ...data.settings, | ||
| }); | ||
| return result; | ||
| }); | ||
| case processesToolNames.scheduleProcess: | ||
| return this.handleToolRequest(ScheduleProcessSchema, request, async (data) => { | ||
| const schedule = await this.yepCodeApi.createSchedule(data.identifier, { | ||
| cron: data.cron, | ||
| dateTime: data.dateTime, | ||
| }); | ||
| return schedule; | ||
| }); | ||
| case executionsToolNames.getExecutions: | ||
| return this.handleToolRequest(GetExecutionsSchema, request, async (data) => { | ||
| const executions = await this.yepCodeApi.getExecutions({ | ||
| keywords: data.keywords, | ||
| processId: data.processId, | ||
| status: data.status, | ||
| from: data.from, | ||
| to: data.to, | ||
| page: data.page, | ||
| limit: data.limit, | ||
| }); | ||
| return executions; | ||
| }); | ||
| case executionsToolNames.getExecution: | ||
| return this.handleToolRequest(GetExecutionSchema, request, async (data) => { | ||
| const execution = await this.yepCodeApi.getExecution(data.id); | ||
| return execution; | ||
| }); | ||
| case executionsToolNames.killExecution: | ||
| return this.handleToolRequest(KillExecutionSchema, request, async (data) => { | ||
| await this.yepCodeApi.killExecution(data.id); | ||
| return { result: `Execution ${data.id} killed successfully` }; | ||
| }); | ||
| case executionsToolNames.rerunExecution: | ||
| return this.handleToolRequest(RerunExecutionSchema, request, async (data) => { | ||
| const execution = await this.yepCodeApi.rerunExecution(data.id); | ||
| return execution; | ||
| }); | ||
| case executionsToolNames.getExecutionLogs: | ||
| return this.handleToolRequest(GetExecutionLogsSchema, request, async (data) => { | ||
| const logs = await this.yepCodeApi.getExecutionLogs(data.id); | ||
| return logs; | ||
| }); | ||
| case modulesToolNames.getModules: | ||
| return this.handleToolRequest(GetModulesSchema, request, async (data) => { | ||
| const modules = await this.yepCodeApi.getModules({ | ||
| page: data.page, | ||
| limit: data.limit, | ||
| }); | ||
| return modules; | ||
| }); | ||
| case modulesToolNames.createModule: | ||
| return this.handleToolRequest(CreateModuleSchema, request, async (data) => { | ||
| const module = await this.yepCodeApi.createModule({ | ||
| name: data.name, | ||
| }); | ||
| return module; | ||
| }); | ||
| case modulesToolNames.getModule: | ||
| return this.handleToolRequest(GetModuleSchema, request, async (data) => { | ||
| const module = await this.yepCodeApi.getModule(data.id); | ||
| return module; | ||
| }); | ||
| case modulesToolNames.deleteModule: | ||
| return this.handleToolRequest(DeleteModuleSchema, request, async (data) => { | ||
| await this.yepCodeApi.deleteModule(data.id); | ||
| return { result: `Module ${data.id} deleted successfully` }; | ||
| }); | ||
| case modulesToolNames.getModuleVersions: | ||
| return this.handleToolRequest(GetModuleVersionsSchema, request, async (data) => { | ||
| const versions = await this.yepCodeApi.getModuleVersions(data.moduleId, { | ||
| page: data.page, | ||
| limit: data.limit, | ||
| }); | ||
| return versions; | ||
| }); | ||
| case modulesToolNames.getModuleVersion: | ||
| return this.handleToolRequest(GetModuleVersionSchema, request, async (data) => { | ||
| // Note: getModuleVersion method doesn't exist in YepCodeApi | ||
| throw new Error("getModuleVersion method not available in YepCodeApi"); | ||
| }); | ||
| case modulesToolNames.deleteModuleVersion: | ||
| return this.handleToolRequest(DeleteModuleVersionSchema, request, async (data) => { | ||
| // Note: deleteModuleVersion method doesn't exist in YepCodeApi | ||
| throw new Error("deleteModuleVersion method not available in YepCodeApi"); | ||
| }); | ||
| case modulesToolNames.getModuleAliases: | ||
| return this.handleToolRequest(GetModuleAliasesSchema, request, async (data) => { | ||
| // Note: getModuleAliases method doesn't exist in YepCodeApi | ||
| throw new Error("getModuleAliases method not available in YepCodeApi"); | ||
| }); | ||
| default: | ||
@@ -327,0 +518,0 @@ this.logger.error(`Unknown tool requested: ${request.params.name}`); |
| import { z } from "zod"; | ||
| export declare const storageToolNames: { | ||
| list: string; | ||
| upload: string; | ||
| download: string; | ||
| delete: string; | ||
| }; | ||
| export declare const ListObjectsSchema: z.ZodObject<{ | ||
| export declare const GetStorageObjectsSchema: z.ZodObject<{ | ||
| prefix: z.ZodOptional<z.ZodString>; | ||
@@ -15,3 +9,3 @@ }, "strip", z.ZodTypeAny, { | ||
| }>; | ||
| export declare const UploadObjectSchema: z.ZodObject<{ | ||
| export declare const UploadStorageObjectSchema: z.ZodObject<{ | ||
| filename: z.ZodString; | ||
@@ -41,3 +35,3 @@ content: z.ZodUnion<[z.ZodString, z.ZodObject<{ | ||
| }>; | ||
| export declare const DownloadObjectSchema: z.ZodObject<{ | ||
| export declare const DownloadStorageObjectSchema: z.ZodObject<{ | ||
| filename: z.ZodString; | ||
@@ -49,3 +43,3 @@ }, "strip", z.ZodTypeAny, { | ||
| }>; | ||
| export declare const DeleteObjectSchema: z.ZodObject<{ | ||
| export declare const DeleteStorageObjectSchema: z.ZodObject<{ | ||
| filename: z.ZodString; | ||
@@ -57,12 +51,95 @@ }, "strip", z.ZodTypeAny, { | ||
| }>; | ||
| export declare const storageToolDefinitions: { | ||
| name: string; | ||
| export declare const storageToolNames: { | ||
| readonly getStorageObjects: "get_storage_objects"; | ||
| readonly uploadStorageObject: "upload_storage_object"; | ||
| readonly downloadStorageObject: "download_storage_object"; | ||
| readonly deleteStorageObject: "delete_storage_object"; | ||
| }; | ||
| export declare const storageToolDefinitions: ({ | ||
| name: "get_storage_objects"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: import("zod-to-json-schema").JsonSchema7Type & { | ||
| $schema?: string | undefined; | ||
| definitions?: { | ||
| [key: string]: import("zod-to-json-schema").JsonSchema7Type; | ||
| } | undefined; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| prefix: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| filename?: undefined; | ||
| content?: undefined; | ||
| }; | ||
| required?: undefined; | ||
| }; | ||
| }[]; | ||
| } | { | ||
| name: "upload_storage_object"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| filename: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| content: { | ||
| oneOf: ({ | ||
| type: string; | ||
| description: string; | ||
| properties?: undefined; | ||
| required?: undefined; | ||
| } | { | ||
| type: string; | ||
| properties: { | ||
| data: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| encoding: { | ||
| type: string; | ||
| enum: string[]; | ||
| description: string; | ||
| }; | ||
| }; | ||
| required: string[]; | ||
| description: string; | ||
| })[]; | ||
| description: string; | ||
| }; | ||
| prefix?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "download_storage_object"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| filename: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| prefix?: undefined; | ||
| content?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| } | { | ||
| name: "delete_storage_object"; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: { | ||
| type: string; | ||
| properties: { | ||
| filename: { | ||
| type: string; | ||
| description: string; | ||
| }; | ||
| prefix?: undefined; | ||
| content?: undefined; | ||
| }; | ||
| required: string[]; | ||
| }; | ||
| })[]; |
| import { z } from "zod"; | ||
| import { zodToJsonSchema } from "zod-to-json-schema"; | ||
| export const storageToolNames = { | ||
| list: "list_files", | ||
| upload: "upload_file", | ||
| download: "download_file", | ||
| delete: "delete_file", | ||
| }; | ||
| export const ListObjectsSchema = z.object({ | ||
| prefix: z | ||
| .string() | ||
| .optional() | ||
| .describe("Prefix to filter files by. Filter results to include only files whose names begin with this prefix"), | ||
| // Schema for getting storage objects | ||
| export const GetStorageObjectsSchema = z.object({ | ||
| prefix: z.string().optional().describe("Filter results to include only objects whose names begin with this prefix (useful for folder-like organization)"), | ||
| }); | ||
| export const UploadObjectSchema = z.object({ | ||
| filename: z | ||
| .string() | ||
| .describe("Filename or path where to upload the file (e.g., 'file.txt' or 'folder/file.txt')"), | ||
| content: z | ||
| .union([ | ||
| // Schema for uploading a storage object | ||
| export const UploadStorageObjectSchema = z.object({ | ||
| filename: z.string().describe("Object filename (can include slashes for folder-like organization, e.g., 'folder/subfolder/file.txt')"), | ||
| content: z.union([ | ||
| z.string().describe("File content as plain text (for text files)"), | ||
| z | ||
| .object({ | ||
| z.object({ | ||
| data: z.string().describe("File content encoded in base64"), | ||
| encoding: z.literal("base64").describe("Encoding type"), | ||
| }) | ||
| .describe("Base64 encoded file content (for binary files)"), | ||
| ]) | ||
| .describe("File content. Use plain text for text files, or base64 object for binary files"), | ||
| }).describe("Base64 encoded file content (for binary files)"), | ||
| ]).describe("File content. Use plain text for text files, or base64 object for binary files"), | ||
| }); | ||
| export const DownloadObjectSchema = z.object({ | ||
| filename: z | ||
| .string() | ||
| .describe("Filename or path where to download the file (e.g., 'file.txt' or 'folder/file.txt')"), | ||
| // Schema for downloading a storage object | ||
| export const DownloadStorageObjectSchema = z.object({ | ||
| filename: z.string().describe("Object filename (can include slashes)"), | ||
| }); | ||
| export const DeleteObjectSchema = z.object({ | ||
| filename: z | ||
| .string() | ||
| .describe("Filename or path where to delete the file (e.g., 'file.txt' or 'folder/file.txt')"), | ||
| // Schema for deleting a storage object | ||
| export const DeleteStorageObjectSchema = z.object({ | ||
| filename: z.string().describe("Object filename (can include slashes)"), | ||
| }); | ||
| // Tool names | ||
| export const storageToolNames = { | ||
| getStorageObjects: "get_storage_objects", | ||
| uploadStorageObject: "upload_storage_object", | ||
| downloadStorageObject: "download_storage_object", | ||
| deleteStorageObject: "delete_storage_object", | ||
| }; | ||
| // Tool definitions | ||
| export const storageToolDefinitions = [ | ||
| { | ||
| name: storageToolNames.list, | ||
| title: "List all files in YepCode Storage", | ||
| description: "List all files that user has previously uploaded to YepCode Storage", | ||
| inputSchema: zodToJsonSchema(ListObjectsSchema), | ||
| name: storageToolNames.getStorageObjects, | ||
| title: "Get Storage Objects", | ||
| description: "Retrieves a list of storage objects in the team's storage bucket. Objects can be filtered by prefix to organize files in folders.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| prefix: { | ||
| type: "string", | ||
| description: "Filter results to include only objects whose names begin with this prefix (useful for folder-like organization)", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| name: storageToolNames.upload, | ||
| title: "Upload a file to YepCode Storage", | ||
| description: "Upload a file to YepCode Storage. Files can be then accessed in your code using the `yepcode.storage` helper methods.", | ||
| inputSchema: zodToJsonSchema(UploadObjectSchema), | ||
| name: storageToolNames.uploadStorageObject, | ||
| title: "Upload Storage Object", | ||
| description: "Uploads a file to the team's storage bucket. Files can be organized using folder-like paths in the filename parameter.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| filename: { | ||
| type: "string", | ||
| description: "Object filename (can include slashes for folder-like organization, e.g., 'folder/subfolder/file.txt')", | ||
| }, | ||
| content: { | ||
| oneOf: [ | ||
| { | ||
| type: "string", | ||
| description: "File content as plain text (for text files)", | ||
| }, | ||
| { | ||
| type: "object", | ||
| properties: { | ||
| data: { | ||
| type: "string", | ||
| description: "File content encoded in base64", | ||
| }, | ||
| encoding: { | ||
| type: "string", | ||
| enum: ["base64"], | ||
| description: "Encoding type", | ||
| }, | ||
| }, | ||
| required: ["data", "encoding"], | ||
| description: "Base64 encoded file content (for binary files)", | ||
| }, | ||
| ], | ||
| description: "File content. Use plain text for text files, or base64 object for binary files", | ||
| }, | ||
| }, | ||
| required: ["filename", "content"], | ||
| }, | ||
| }, | ||
| { | ||
| name: storageToolNames.download, | ||
| title: "Download a file from YepCode Storage", | ||
| description: "Download a file from YepCode Storage.", | ||
| inputSchema: zodToJsonSchema(DownloadObjectSchema), | ||
| name: storageToolNames.downloadStorageObject, | ||
| title: "Download Storage Object", | ||
| description: "Downloads a file from the team's storage bucket. The file content is returned as binary data with appropriate headers.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| filename: { | ||
| type: "string", | ||
| description: "Object filename (can include slashes)", | ||
| }, | ||
| }, | ||
| required: ["filename"], | ||
| }, | ||
| }, | ||
| { | ||
| name: storageToolNames.delete, | ||
| title: "Delete a file from YepCode Storage", | ||
| description: "Delete a file from YepCode Storage.", | ||
| inputSchema: zodToJsonSchema(DeleteObjectSchema), | ||
| name: storageToolNames.deleteStorageObject, | ||
| title: "Delete Storage Object", | ||
| description: "Permanently deletes a file from the team's storage bucket. This action cannot be undone.", | ||
| inputSchema: { | ||
| type: "object", | ||
| properties: { | ||
| filename: { | ||
| type: "string", | ||
| description: "Object filename (can include slashes)", | ||
| }, | ||
| }, | ||
| required: ["filename"], | ||
| }, | ||
| }, | ||
| ]; |
+3
-3
| { | ||
| "name": "@yepcode/mcp-server", | ||
| "version": "0.12.0", | ||
| "version": "1.0.0", | ||
| "description": "MCP server for YepCode", | ||
@@ -49,7 +49,7 @@ "main": "dist/index.js", | ||
| "type-check": "tsc --noEmit", | ||
| "inspector": "npx @modelcontextprotocol/inspector@0.13.0 node --env-file=.env dist/index.js" | ||
| "inspector": "npx @modelcontextprotocol/inspector@0.17.2 node --env-file=.env dist/index.js" | ||
| }, | ||
| "dependencies": { | ||
| "@modelcontextprotocol/sdk": "^1.19.1", | ||
| "@yepcode/run": "^1.9.0", | ||
| "@yepcode/run": "^1.10.0", | ||
| "dotenv": "^16.4.7", | ||
@@ -56,0 +56,0 @@ "zod": "^3.24.2" |
+52
-26
@@ -163,10 +163,8 @@  | ||
| - `run_code`: Enables the code execution tool | ||
| - `executions`: Enables execution management tools | ||
| - `env_vars`: Enables environment variable management tools | ||
| - `storage`: Enables storage management tools | ||
| - `yc_api`: Enables all API management tools (processes, schedules, variables, storage, executions, modules) | ||
| **Process tags:** | ||
| - Any tag used in your YepCode processes (e.g., `mcp-tool`, `core`, `api`, `automation`, etc.) | ||
| - Any tag used in your YepCode processes (e.g., `mcp-tool`, `core`, `automation`, etc.) | ||
| - When you specify a process tag, all processes with that tag will be exposed as individual MCP tools | ||
| - Process tools will be named `run_ycp_<process_slug>` (or `run_ycp_<process_id>` if the name is longer than 60 characters) | ||
| - Process tools will be named using the process slug (or prefixed with `yc_` and the process ID if the name is longer than 60 characters) | ||
@@ -180,3 +178,3 @@ If not specified, all built-in tools are enabled by default, but no process tools will be exposed. | ||
| "yepcode-mcp-server": { | ||
| "url": "https://cloud.yepcode.io/mcp/sk-c2E....RD/sse?mcpOptions=runCodeCleanup&tools=run_code,storage,env_vars,core,api" | ||
| "url": "https://cloud.yepcode.io/mcp/sk-c2E....RD/sse?mcpOptions=runCodeCleanup&tools=run_code,yc_api,mcp-tool,core" | ||
| } | ||
@@ -195,3 +193,3 @@ } | ||
| "YEPCODE_MCP_OPTIONS": "runCodeCleanup", | ||
| "YEPCODE_MCP_TOOLS": "run_code,storage,env_vars,core,api" | ||
| "YEPCODE_MCP_TOOLS": "run_code,yc_api,mcp-tool,core" | ||
| } | ||
@@ -204,5 +202,5 @@ } | ||
| **Example scenarios:** | ||
| - `YEPCODE_MCP_TOOLS=run_code,storage` - Only enables built-in code execution and storage tools | ||
| - `YEPCODE_MCP_TOOLS=run_code,yc_api` - Enables built-in code execution and API management tools | ||
| - `YEPCODE_MCP_TOOLS=core,automation` - Only exposes processes tagged with "core" or "automation" as tools | ||
| - `YEPCODE_MCP_TOOLS=run_code,storage,core` - Enables built-in tools plus all processes tagged with "core" | ||
| - `YEPCODE_MCP_TOOLS=run_code,yc_api,core` - Enables built-in tools plus all processes tagged with "core" | ||
@@ -324,7 +322,7 @@ ### Environment Management | ||
| There will be a tool for each exposed process: `run_ycp_<process_slug>` (or `run_ycp_<process_id>` if tool name is longer than 60 characters). | ||
| There will be a tool for each exposed process named using the process slug (or prefixed with `yc_` and the process ID if the tool name is longer than 60 characters). | ||
| For more information about process tags, see our [process tags documentation](https://yepcode.io/docs/processes/tags). | ||
| #### run_ycp_<process_slug> | ||
| #### <process_slug> | ||
@@ -356,23 +354,51 @@ ```typescript | ||
| #### get_execution | ||
| ### API Management Tools | ||
| Retrieves the result of a process execution. | ||
| The `yc_api` tool category provides comprehensive API access to manage all aspects of your YepCode workspace: | ||
| ```typescript | ||
| // Input | ||
| { | ||
| executionId: string; // ID of the execution to retrieve | ||
| } | ||
| **Processes Management:** | ||
| - `get_processes` - List processes with optional filtering | ||
| - `create_process` - Create new processes with source code | ||
| - `get_process` - Get process details | ||
| - `delete_process` - Delete a process | ||
| - `get_process_versions` - Get process versions | ||
| - `execute_process_async` - Execute a process asynchronously | ||
| - `execute_process_sync` - Execute a process synchronously | ||
| - `schedule_process` - Schedule a process to run automatically | ||
| // Response | ||
| { | ||
| executionId: string; // Unique execution identifier | ||
| logs: string[]; // Process execution logs | ||
| returnValue?: unknown; // Process output | ||
| error?: string; // Error message if execution failed | ||
| } | ||
| ``` | ||
| **Schedules Management:** | ||
| - `get_schedules` - List scheduled processes | ||
| - `get_schedule` - Get schedule details | ||
| - `pause_schedule` - Pause a scheduled process | ||
| - `resume_schedule` - Resume a paused schedule | ||
| - `delete_schedule` - Delete a schedule | ||
| **Variables Management:** | ||
| - `get_variables` - List team variables | ||
| - `create_variable` - Create a new variable | ||
| - `update_variable` - Update an existing variable | ||
| - `delete_variable` - Delete a variable | ||
| **Storage Management:** | ||
| - `get_storage_objects` - List storage objects | ||
| - `upload_storage_object` - Upload a file to storage | ||
| - `download_storage_object` - Download a file from storage | ||
| - `delete_storage_object` - Delete a file from storage | ||
| **Executions Management:** | ||
| - `get_executions` - List executions with optional filtering | ||
| - `get_execution` - Get execution details from API | ||
| - `kill_execution` - Kill a running execution | ||
| - `rerun_execution` - Rerun a previous execution | ||
| - `get_execution_logs` - Get execution logs | ||
| **Modules Management:** | ||
| - `get_modules` - List script library modules | ||
| - `create_module` - Create a new module | ||
| - `get_module` - Get module details | ||
| - `delete_module` - Delete a module | ||
| - `get_module_versions` - Get module versions | ||
| ## License | ||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| import { z } from "zod"; | ||
| export declare const envVarsToolNames: { | ||
| set: string; | ||
| remove: string; | ||
| }; | ||
| export declare const EnvVarKeySchema: z.ZodString; | ||
| export declare const SetEnvVarSchema: z.ZodObject<{ | ||
| key: z.ZodString; | ||
| value: z.ZodString; | ||
| isSensitive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| value: string; | ||
| key: string; | ||
| isSensitive: boolean; | ||
| }, { | ||
| value: string; | ||
| key: string; | ||
| isSensitive?: boolean | undefined; | ||
| }>; | ||
| export declare const RemoveEnvVarSchema: z.ZodObject<{ | ||
| key: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| key: string; | ||
| }, { | ||
| key: string; | ||
| }>; | ||
| export type SetEnvVarRequestSchema = z.infer<typeof SetEnvVarSchema>; | ||
| export type RemoveEnvVarRequestSchema = z.infer<typeof RemoveEnvVarSchema>; | ||
| export interface EnvVarResultSchema { | ||
| error?: string; | ||
| } | ||
| export declare const envVarsToolDefinitions: { | ||
| name: string; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: import("zod-to-json-schema").JsonSchema7Type & { | ||
| $schema?: string | undefined; | ||
| definitions?: { | ||
| [key: string]: import("zod-to-json-schema").JsonSchema7Type; | ||
| } | undefined; | ||
| }; | ||
| }[]; |
| import { z } from "zod"; | ||
| import { zodToJsonSchema } from "zod-to-json-schema"; | ||
| export const envVarsToolNames = { | ||
| set: "set_env_var", | ||
| remove: "remove_env_var", | ||
| }; | ||
| export const EnvVarKeySchema = z | ||
| .string() | ||
| .min(1) | ||
| .max(255) | ||
| .regex(/^[a-zA-Z][a-zA-Z0-9_]*$/); | ||
| export const SetEnvVarSchema = z.object({ | ||
| key: EnvVarKeySchema, | ||
| value: z.string(), | ||
| isSensitive: z.boolean().optional().default(true), | ||
| }); | ||
| export const RemoveEnvVarSchema = z.object({ | ||
| key: EnvVarKeySchema, | ||
| }); | ||
| export const envVarsToolDefinitions = [ | ||
| { | ||
| name: envVarsToolNames.set, | ||
| title: "Set environment variable", | ||
| description: "Set a YepCode environment variable to be available for future code executions", | ||
| inputSchema: zodToJsonSchema(SetEnvVarSchema), | ||
| }, | ||
| { | ||
| name: envVarsToolNames.remove, | ||
| title: "Remove environment variable", | ||
| description: "Remove a YepCode environment variable", | ||
| inputSchema: zodToJsonSchema(RemoveEnvVarSchema), | ||
| }, | ||
| ]; |
| import { z } from "zod"; | ||
| export declare const getExecutionToolNames: { | ||
| getExecution: string; | ||
| }; | ||
| export declare const GetExecutionSchema: z.ZodObject<{ | ||
| executionId: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| executionId: string; | ||
| }, { | ||
| executionId: string; | ||
| }>; | ||
| export declare const getExecutionToolDefinitions: { | ||
| name: string; | ||
| title: string; | ||
| description: string; | ||
| inputSchema: import("zod-to-json-schema").JsonSchema7Type & { | ||
| $schema?: string | undefined; | ||
| definitions?: { | ||
| [key: string]: import("zod-to-json-schema").JsonSchema7Type; | ||
| } | undefined; | ||
| }; | ||
| }[]; |
| import { z } from "zod"; | ||
| import { zodToJsonSchema } from "zod-to-json-schema"; | ||
| export const getExecutionToolNames = { | ||
| getExecution: "get_execution", | ||
| }; | ||
| export const GetExecutionSchema = z.object({ | ||
| executionId: z.string(), | ||
| }); | ||
| export const getExecutionToolDefinitions = [ | ||
| { | ||
| name: getExecutionToolNames.getExecution, | ||
| title: "Get process execution", | ||
| description: "Get the status, result, logs, timeline, etc. of a YepCode execution", | ||
| inputSchema: zodToJsonSchema(GetExecutionSchema), | ||
| }, | ||
| ]; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
145430
181.15%27
28.57%3665
258.96%0
-100%399
6.97%2
100%Updated