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
- INPUT_SCHEMA =
{ type: 'object', properties: { action: { type: 'string', enum: ['list', 'install', 'update'], description: 'Content action (default: list)' }, pack_name: { type: 'string', description: 'Content pack name (required for install)' } } }.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.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/rosett_ai/mcp/tools/content_tool.rb', line 49 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 |