Class: RosettAi::Mcp::Tools::ContentTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::ContentTool
- Defined in:
- lib/rosett_ai/mcp/tools/content_tool.rb
Overview
MCP tool: manage content packs.
List, install, or update content packs. Write operation for install/update actions.
Constant Summary collapse
- TOOL_NAME =
'rai_content'- DESCRIPTION =
'List, install, or update rai content packs'- ANNOTATIONS =
{ 'readOnlyHint' => false, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => true }.freeze
- VALID_ACTIONS =
['list', 'install', 'update'].freeze
Instance Method Summary collapse
-
#call(action: 'list', pack_name: nil) ⇒ Hash
Executes the content pack operation.
Instance Method Details
#call(action: 'list', pack_name: nil) ⇒ Hash
Executes the content pack operation.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rosett_ai/mcp/tools/content_tool.rb', line 34 def call(action: 'list', pack_name: nil) return ResponseHelper.error("Invalid action: #{action}") unless VALID_ACTIONS.include?(action) manager = RosettAi::ContentPacks::Manager.new case action when 'list' then { packs: manager.list } when 'install' then action_install(manager, pack_name) when 'update' then action_update(manager) end rescue StandardError => e ResponseHelper.error("Content #{action} failed: #{e.}") end |