Class: RosettAi::Mcp::Tools::ValidateTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::ValidateTool
- Defined in:
- lib/rosett_ai/mcp/tools/validate_tool.rb
Overview
MCP tool: validate rai configuration files.
Performs both YAML syntax and JSON Schema validation using the project's Validators::SchemaValidator hierarchy. Read-only operation.
Constant Summary collapse
- TOOL_NAME =
'rai_validate'- DESCRIPTION =
'Validate rai configuration files (behaviours, designs, tooling)'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
- SCOPE_VALIDATORS =
Maps scope names to their validator classes.
{ 'behaviour' => -> { RosettAi::Validators::BehaviourValidator.new }, 'design' => -> { RosettAi::Validators::DesignValidator.new }, 'tooling' => -> { RosettAi::Validators::ToolingValidator.new } }.freeze
Instance Method Summary collapse
-
#call(scope: nil) ⇒ Hash
Executes the validation with JSON Schema checking.
Instance Method Details
#call(scope: nil) ⇒ Hash
Executes the validation with JSON Schema checking.
41 42 43 44 45 46 47 48 |
# File 'lib/rosett_ai/mcp/tools/validate_tool.rb', line 41 def call(scope: nil) results = { valid: true, errors: [], warnings: [] } scopes = scope ? [scope] : ['behaviour', 'design'] scopes.each { |s| validate_scope(s, results) } results[:valid] = results[:errors].empty? results end |