Class: RosettAi::Mcp::Tools::RetrofitTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::RetrofitTool
- Defined in:
- lib/rosett_ai/mcp/tools/retrofit_tool.rb
Overview
MCP tool: retrofit native configurations.
Scan and convert native AI tool configs to Rosett-AI YAML. Write operation for convert action.
Constant Summary collapse
- TOOL_NAME =
'rai_retrofit'- DESCRIPTION =
'Scan and convert native AI configs to rosett-ai format'- ANNOTATIONS =
{ 'readOnlyHint' => false, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
- VALID_ACTIONS =
['engines', 'scan', 'convert'].freeze
Instance Method Summary collapse
-
#call(action: 'scan', engine: nil, simulate: true) ⇒ Hash
Executes the retrofit operation.
Instance Method Details
#call(action: 'scan', engine: nil, simulate: true) ⇒ Hash
Executes the retrofit operation.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rosett_ai/mcp/tools/retrofit_tool.rb', line 35 def call(action: 'scan', engine: nil, simulate: true) return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action) retrofitter = RosettAi::Retrofit::Scanner.new case action when 'engines' then { parsers: retrofitter.available_parsers } when 'scan' then { findings: retrofitter.scan } when 'convert' then action_convert(retrofitter, engine, simulate) end rescue StandardError => e ResponseHelper.error("Retrofit #{action} failed: #{e.}") end |