Class: RosettAi::Mcp::Tools::InitTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::InitTool
- Defined in:
- lib/rosett_ai/mcp/tools/init_tool.rb
Overview
MCP tool: initialize rosett-ai structure.
Sets up global, local, or project directory structure. Write operation — creates directories and files.
Constant Summary collapse
- TOOL_NAME =
'rai_init'- DESCRIPTION =
'Initialize rosett-ai directory structure (global, local, or project)'- ANNOTATIONS =
{ 'readOnlyHint' => false, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
Instance Method Summary collapse
-
#call(global: false, local: false, project: false) ⇒ Hash
Executes the initialization.
Instance Method Details
#call(global: false, local: false, project: false) ⇒ Hash
Executes the initialization.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/rosett_ai/mcp/tools/init_tool.rb', line 33 def call(global: false, local: false, project: false) unless global || local || project return ResponseHelper.error('At least one scope required: global, local, or project') end results = { scopes: [], created: [] } init_global(results) if global init_local(results) if local init_project(results) if project ResponseHelper.success('Initialization complete', results) rescue StandardError => e ResponseHelper.error("Init failed: #{e.}") end |