Class: HTM::MCP::GroupRecallTool
- Inherits:
-
FastMcp::Tool
- Object
- FastMcp::Tool
- HTM::MCP::GroupRecallTool
- Defined in:
- lib/htm/mcp/group_tools.rb
Overview
Tool: Recall from group’s shared memory
Instance Method Summary collapse
Instance Method Details
#call(group_name:, query:, limit: 10, strategy: 'hybrid') ⇒ Object
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/htm/mcp/group_tools.rb', line 272 def call(group_name:, query:, limit: 10, strategy: 'hybrid') Session.logger&.info "GroupRecallTool called: group=#{group_name.inspect}, query=#{query.inspect}" group = GroupSession.get_group(group_name) unless group return { success: false, error: "Group '#{group_name}' not found in this session" }.to_json end memories = group.recall(query, limit: limit, strategy: strategy.to_sym) Session.logger&.info "GroupRecallTool complete: found #{memories.length} memories" { success: true, group_name: group_name, query: query, strategy: strategy, count: memories.length, results: memories }.to_json rescue StandardError => e Session.logger&.error "GroupRecallTool error: #{e.}" { success: false, error: e. }.to_json end |