Class: RosettAi::Mcp::Tools::BehaviourListTool

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

Overview

MCP tool: list rai behaviour files.

Returns a structured list of all behaviour files with metadata (name, version, rule count, enabled status).

Author:

  • hugo

  • claude

Constant Summary collapse

TOOL_NAME =
'rai_behaviour_list'
DESCRIPTION =
'List all rai behaviour configuration files'
ANNOTATIONS =
{
  'readOnlyHint' => true,
  'destructiveHint' => false,
  'idempotentHint' => true,
  'openWorldHint' => false
}.freeze

Instance Method Summary collapse

Instance Method Details

#callHash

Executes the listing.

Returns:

  • (Hash)

    result with :behaviours array



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

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

  behaviours = dir.glob('*.yml').filter_map { |path| load_behaviour(path) }
  { behaviours: behaviours }
end