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
INPUT_SCHEMA =
{
  type: 'object',
  properties: {
    action: {
      type: 'string',
      enum: ['list', 'detect', 'status'],
      description: 'Engine action (default: list)'
    }
  }
}.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



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rosett_ai/mcp/tools/engines_tool.rb', line 44

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