Class: RosettAi::Mcp::Tools::WorkflowExecuteTool

Inherits:
Object
  • Object
show all
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.

Author:

  • hugo

  • claude

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

Instance Method Details

#call(name:, resume: false) ⇒ Hash

Executes the named workflow.

Parameters:

  • name (String)

    workflow name

  • resume (Boolean) (defaults to: false)

    resume a previously interrupted workflow

Returns:

  • (Hash)

    execution results



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.message}")
end