Class: RosettAi::Mcp::Tools::WorkflowTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::WorkflowTool
- Defined in:
- lib/rosett_ai/mcp/tools/workflow_tool.rb
Overview
MCP tool: query workflow definitions.
Lists, validates, and simulates declarative workflows. Read-only operation.
Constant Summary collapse
- TOOL_NAME =
'rai_workflow'- DESCRIPTION =
'List, validate, or simulate rai workflows'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
- VALID_ACTIONS =
['list', 'validate', 'simulate'].freeze
Instance Method Summary collapse
-
#call(action: 'list', name: nil) ⇒ Hash
Executes the workflow query.
Instance Method Details
#call(action: 'list', name: nil) ⇒ Hash
Executes the workflow query.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rosett_ai/mcp/tools/workflow_tool.rb', line 34 def call(action: 'list', name: nil) return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action) manager = RosettAi::Workflow::Manager.new case action when 'list' then { workflows: manager.list } when 'validate' then action_validate(manager, name) when 'simulate' then action_simulate(manager, name) end rescue StandardError => e ResponseHelper.error("Workflow #{action} failed: #{e.}") end |