Class: RosettAi::Mcp::Tools::EnginesTool

Inherits:
Object
  • Object
show all
Defined in:
lib/rosett_ai/mcp/tools/engines_tool.rb

Overview

MCP tool: manage and query rai engines.

Lists, detects, and shows status of installed engines. Read-only operation.

Author:

  • hugo

  • claude

Constant Summary collapse

TOOL_NAME =
'rosett_ai_engines'
DESCRIPTION =
'List, detect, or show status of rai engines'
ANNOTATIONS =
{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.freeze
VALID_ACTIONS =
['list', 'detect', 'status'].freeze

Instance Method Summary collapse

Instance Method Details

#call(action: 'list') ⇒ Hash

Executes the engine query.

Parameters:

  • action (String) (defaults to: 'list')

    one of 'list', 'detect', 'status'

Returns:

  • (Hash)

    engine information



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/rosett_ai/mcp/tools/engines_tool.rb', line 33

def call(action: 'list')
  return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action)

  case action
  when 'list' then action_list
  when 'detect' then action_detect
  when 'status' then action_status
  end
rescue StandardError => e
  ResponseHelper.error("Engine #{action} failed: #{e.message}")
end