Class: RosettAi::Mcp::Tools::ToolingTool

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

Overview

MCP tool: run tooling validation.

Validates CI YAML syntax and checks tool versions. Read-only operation.

Author:

  • hugo

  • claude

Constant Summary collapse

TOOL_NAME =
'rai_tooling'
DESCRIPTION =
'Run tooling validation (CI YAML, version checks)'
ANNOTATIONS =
{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.freeze
VALID_ACTIONS =
['validate-ci-yaml', 'check-versions'].freeze

Instance Method Summary collapse

Instance Method Details

#call(action: 'validate-ci-yaml', verbose: false) ⇒ Hash

Executes tooling validation.

Parameters:

  • action (String) (defaults to: 'validate-ci-yaml')

    one of 'validate-ci-yaml', 'check-versions'

  • verbose (Boolean) (defaults to: false)

    show detailed output

Returns:

  • (Hash)

    validation results



34
35
36
37
38
39
40
41
42
43
# File 'lib/rosett_ai/mcp/tools/tooling_tool.rb', line 34

def call(action: 'validate-ci-yaml', verbose: false)
  return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action)

  case action
  when 'validate-ci-yaml' then validate_ci_yaml(verbose)
  when 'check-versions' then check_versions(verbose)
  end
rescue StandardError => e
  ResponseHelper.error("Tooling #{action} failed: #{e.message}")
end