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
- INPUT_SCHEMA =
{ type: 'object', properties: { global: { type: 'boolean', description: 'Initialize global ~/.claude/ structure (default: false)' }, local: { type: 'boolean', description: 'Initialize project-local .claude/ structure (default: false)' }, project: { type: 'boolean', description: 'Initialize .rosett-ai/ project structure (default: 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.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/rosett_ai/mcp/tools/init_tool.rb', line 51 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 |