Class: RosettAi::Mcp::Tools::WorkflowExecuteTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::WorkflowExecuteTool
- Defined in:
- lib/rosett_ai/mcp/tools/workflow_execute_tool.rb
Overview
MCP tool: execute a named workflow.
Runs a declarative workflow by name. Write operation — executes workflow steps.
Constant Summary collapse
- TOOL_NAME =
Returns MCP tool identifier string.
'rai_workflow_execute'- DESCRIPTION =
Returns Human-readable description of this tool.
'Execute a named rai workflow'- ANNOTATIONS =
Returns MCP protocol annotations describing tool capabilities.
{ 'readOnlyHint' => false, 'destructiveHint' => false, 'idempotentHint' => false, 'openWorldHint' => false }.freeze
- INPUT_SCHEMA =
Returns JSON Schema defining the tool input parameters.
{ type: 'object', properties: { name: { type: 'string', description: 'Workflow name to execute' }, resume: { type: 'boolean', description: 'Resume a previously interrupted workflow (default: false)' } }, required: ['name'] }.freeze
Instance Method Summary collapse
-
#call(name:, resume: false) ⇒ Hash
Executes the named workflow.
Instance Method Details
#call(name:, resume: false) ⇒ Hash
Executes the named workflow.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/rosett_ai/mcp/tools/workflow_execute_tool.rb', line 51 def call(name:, resume: false) return ResponseHelper.error('Workflow name is required') if name.nil? || name.empty? path = resolve_workflow(name) return ResponseHelper.error("Workflow '#{name}' not found") unless path engine = RosettAi::Workflow::Engine.new(workflow_path: path) build_result(name, engine.execute(resume: resume)) rescue StandardError => e ResponseHelper.error("Workflow execute failed: #{e.}") end |