Class: RosettAi::Mcp::Tools::BehaviourManageTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::BehaviourManageTool
- Defined in:
- lib/rosett_ai/mcp/tools/behaviour_manage_tool.rb
Overview
MCP tool: manage behaviour files.
Add, modify, or delete behaviour configurations. Write operation — destructive when action is 'delete'.
Constant Summary collapse
- TOOL_NAME =
'rai_behaviour_manage'- DESCRIPTION =
'Add, modify, or delete rai behaviour files'- ANNOTATIONS =
{ 'readOnlyHint' => false, 'destructiveHint' => true, 'idempotentHint' => false, 'openWorldHint' => false }.freeze
- VALID_ACTIONS =
['add', 'modify', 'delete'].freeze
Instance Method Summary collapse
-
#call(action:, name:, description: nil, force: false) ⇒ Hash
Executes the behaviour management operation.
Instance Method Details
#call(action:, name:, description: nil, force: false) ⇒ Hash
Executes the behaviour management operation.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rosett_ai/mcp/tools/behaviour_manage_tool.rb', line 36 def call(action:, name:, description: nil, force: false) return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action) return ResponseHelper.error('Name is required') if name.nil? || name.empty? case action when 'add' then action_add(name, description: description) when 'modify' then action_modify(name, description: description) when 'delete' then action_delete(name, force: force) end rescue StandardError => e ResponseHelper.error("Behaviour #{action} failed: #{e.}") end |