Class: RosettAi::Mcp::Tools::BehaviourDisplayTool

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

Overview

MCP tool: display behaviour configuration table.

Returns a formatted overview of all behaviours with their rules, versions, and enabled status.

Author:

  • hugo

  • claude

Constant Summary collapse

TOOL_NAME =

Returns MCP tool identifier string.

Returns:

  • (String)

    MCP tool identifier string.

'rai_behaviour_display'
DESCRIPTION =

Returns Human-readable description of this tool.

Returns:

  • (String)

    Human-readable description of this tool.

'Display behaviour configuration overview'
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
INPUT_SCHEMA =

Returns JSON Schema defining the tool input parameters.

Returns:

  • (Hash)

    JSON Schema defining the tool input parameters.

{
  type: 'object',
  properties: {
    format: {
      type: 'string',
      enum: ['json', 'table'],
      description: 'Output format (default: json)'
    }
  }
}.freeze

Instance Method Summary collapse

Instance Method Details

#call(format: 'json') ⇒ Hash

Executes the display operation.

Parameters:

  • format (String) (defaults to: 'json')

    output format ('table' or 'json')

Returns:

  • (Hash)

    formatted behaviour display



46
47
48
49
50
51
52
# File 'lib/rosett_ai/mcp/tools/behaviour_display_tool.rb', line 46

def call(format: 'json')
  dir = RosettAi.root.join('conf', 'behaviour')
  return { behaviours: [], format: format } unless dir.directory?

  behaviours = dir.glob('*.yml').filter_map { |path| load_display(path) }
  { behaviours: behaviours, format: format, total: behaviours.size }
end