Class: RosettAi::Mcp::Tools::BehaviourShowTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::BehaviourShowTool
- Defined in:
- lib/rosett_ai/mcp/tools/behaviour_show_tool.rb
Overview
MCP tool: show a specific behaviour file.
Returns the full content and metadata of a named behaviour. Read-only operation.
Constant Summary collapse
- TOOL_NAME =
'rai_behaviour_show'- DESCRIPTION =
'Show details of a specific rai behaviour'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
Instance Method Summary collapse
-
#call(name:) ⇒ Hash
Executes the show operation.
Instance Method Details
#call(name:) ⇒ Hash
Executes the show operation.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rosett_ai/mcp/tools/behaviour_show_tool.rb', line 31 def call(name:) path = RosettAi.root.join('conf', 'behaviour', "#{name}.yml") return ResponseHelper.error("Behaviour not found: #{name}") unless path.exist? data = YAML.safe_load_file(path, permitted_classes: [Symbol]) { name: data['name'], description: data['description'], version: data['version'], author: data['author'], rules: Array(data['rules']), sensitive: data['sensitive'] || false, file: path.basename.to_s } rescue Psych::SyntaxError => e ResponseHelper.error("YAML parse error in #{name}: #{e.}") end |