21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/legion/mcp/tools/get_config.rb', line 21
def call(section: nil)
log.info('Starting legion.mcp.tools.get_config.call')
settings = Legion::Settings.loader.to_hash
if section
key = section.to_sym
return error_response("Setting '#{section}' not found") unless settings.key?(key)
value = settings[key]
value = redact_hash(value) if value.is_a?(Hash)
text_response({ key: key, value: value })
else
text_response(redact_hash(settings))
end
rescue StandardError => e
handle_exception(e, level: :warn, operation: 'legion.mcp.tools.get_config.call')
log.warn("GetConfig#call failed: #{e.message}")
error_response("Failed to get config: #{e.message}")
end
|