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
INPUT_SCHEMA =
{
  type: 'object',
  properties: {
    action: {
      type: 'string',
      enum: ['validate-ci-yaml', 'check-versions'],
      description: 'Tooling action (default: validate-ci-yaml)'
    },
    verbose: {
      type: 'boolean',
      description: 'Show detailed output (default: false)'
    }
  }
}.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



49
50
51
52
53
54
55
56
57
58
# File 'lib/rosett_ai/mcp/tools/tooling_tool.rb', line 49

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