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 =
'rai_behaviour_display'
DESCRIPTION =
'Display behaviour configuration overview'
ANNOTATIONS =
{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.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



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

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