21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/legion/mcp/tools/notify_peer.rb', line 21
def call(to:, message:)
log.info('Starting legion.mcp.tools.notify_peer.call')
return error_response('lex-mesh is not available') unless mesh_available?
result = mesh_client.send_message(
from: 'legion.mcp',
to: to,
pattern: :unicast,
payload: { message: message }
)
text_response(result)
rescue StandardError => e
handle_exception(e, level: :warn, operation: 'legion.mcp.tools.notify_peer.call')
log.warn("NotifyPeer#call failed: #{e.message}")
error_response("Failed to notify peer: #{e.message}")
end
|