Class: RosettAi::Mcp::Tools::BehaviourDisplayTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::BehaviourDisplayTool
- 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.
Constant Summary collapse
- TOOL_NAME =
Returns MCP tool identifier string.
'rai_behaviour_display'- DESCRIPTION =
Returns Human-readable description of this tool.
'Display behaviour configuration overview'- ANNOTATIONS =
Returns 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.
{ type: 'object', properties: { format: { type: 'string', enum: ['json', 'table'], description: 'Output format (default: json)' } } }.freeze
Instance Method Summary collapse
-
#call(format: 'json') ⇒ Hash
Executes the display operation.
Instance Method Details
#call(format: 'json') ⇒ Hash
Executes the display operation.
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 |