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 =
'rai_workflow_execute'- DESCRIPTION =
'Execute a named rai workflow'- ANNOTATIONS =
{ 'readOnlyHint' => false, 'destructiveHint' => false, 'idempotentHint' => false, 'openWorldHint' => false }.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.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rosett_ai/mcp/tools/workflow_execute_tool.rb', line 32 def call(name:, resume: false) return ResponseHelper.error('Workflow name is required') if name.nil? || name.empty? manager = RosettAi::Workflow::Manager.new result = manager.execute(name, resume: resume) { name: name, status: result[:status], steps_completed: result[:steps_completed], output: result[:output] } rescue StandardError => e ResponseHelper.error("Workflow execute failed: #{e.}") end |