Class: RosettAi::Mcp::Tools::ValidateTool

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

Overview

MCP tool: validate rai configuration files.

Runs behaviour, design, and tooling validation and returns structured results. Read-only operation.

Author:

  • hugo

  • claude

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

Instance Method Summary collapse

Instance Method Details

#call(scope: nil) ⇒ Hash

Executes the validation.

Parameters:

  • scope (String, nil) (defaults to: nil)

    optional scope filter ('behaviour', 'design', 'tooling')

Returns:

  • (Hash)

    result with :valid, :errors, :warnings



31
32
33
34
35
36
37
38
# File 'lib/rosett_ai/mcp/tools/validate_tool.rb', line 31

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