Class: RosettAi::Mcp::Tools::DoctorTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::DoctorTool
- Defined in:
- lib/rosett_ai/mcp/tools/doctor_tool.rb
Overview
MCP tool: run rosett-ai diagnostics.
Executes system diagnostic checks and reports status. Read-only operation.
Constant Summary collapse
- TOOL_NAME =
'rai_doctor'- DESCRIPTION =
'Run rosett-ai diagnostic checks'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
- INPUT_SCHEMA =
{ type: 'object', properties: { check: { type: 'string', description: 'Run a specific diagnostic check (default: all)' }, format: { type: 'string', enum: ['json', 'text'], description: 'Output format (default: json)' } } }.freeze
Instance Method Summary collapse
-
#call(check: nil, format: 'json') ⇒ Hash
Executes diagnostic checks.
Instance Method Details
#call(check: nil, format: 'json') ⇒ Hash
Executes diagnostic checks.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/rosett_ai/mcp/tools/doctor_tool.rb', line 47 def call(check: nil, format: 'json') doctor = RosettAi::Doctor::Runner.new results = check ? doctor.run_check(check) : doctor.run_all { healthy: results[:failures].empty?, checks: results[:checks], failures: results[:failures], format: format } rescue StandardError => e ResponseHelper.error("Doctor check failed: #{e.}") end |