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 =

Returns MCP tool identifier string.

Returns:

  • (String)

    MCP tool identifier string.

'rai_tooling'
DESCRIPTION =

Returns Human-readable description of this tool.

Returns:

  • (String)

    Human-readable description of this tool.

'Run tooling validation (CI YAML, version checks)'
ANNOTATIONS =

Returns MCP protocol annotations describing tool capabilities.

Returns:

  • (Hash)

    MCP protocol annotations describing tool capabilities.

{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.freeze
VALID_ACTIONS =

Returns Set of permitted action values.

Returns:

  • (Array)

    Set of permitted action values.

['validate-ci-yaml', 'check-versions'].freeze
INPUT_SCHEMA =

Returns JSON Schema defining the tool input parameters.

Returns:

  • (Hash)

    JSON Schema defining the tool input parameters.

{
  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



54
55
56
57
58
59
60
61
62
63
# File 'lib/rosett_ai/mcp/tools/tooling_tool.rb', line 54

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