Class: Legion::MCP::Tools::MindGrowthPropose

Inherits:
MCP::Tool
  • Object
show all
Extended by:
Logging::Helper
Defined in:
lib/legion/mcp/tools/mind_growth_propose.rb

Class Method Summary collapse

Class Method Details

.call(params = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/legion/mcp/tools/mind_growth_propose.rb', line 23

def call(params = {})
  log.info('Starting legion.mcp.tools.mind_growth_propose.call')
  return error_response('lex-mind-growth is not available') unless mind_growth_available?

  result = mind_growth_client.propose_concept(
    category:    params[:category]&.to_sym,
    description: params[:description],
    name:        params[:name]
  )
  text_response(result)
rescue StandardError => e
  handle_exception(e, level: :warn, operation: 'legion.mcp.tools.mind_growth_propose.call')
  log.warn("MindGrowthPropose#call failed: #{e.message}")
  error_response("Failed to propose concept: #{e.message}")
end