Class: HTM::MCP::RememberTool
- Inherits:
-
FastMcp::Tool
- Object
- FastMcp::Tool
- HTM::MCP::RememberTool
- Defined in:
- lib/htm/mcp/tools.rb
Overview
Tool: Remember information
Instance Method Summary collapse
Instance Method Details
#call(content:, tags: [], metadata: {}) ⇒ Object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/htm/mcp/tools.rb', line 135 def call(content:, tags: [], metadata: {}) Session.logger&.info "RememberTool called: content=#{content[0..50].inspect}..." htm = Session.htm_instance node_id = htm.remember(content, tags: , metadata: ) node = HTM::Models::Node.eager(:tags).first!(id: node_id) Session.logger&.info "Memory stored: node_id=#{node_id}, robot=#{htm.robot_name}, tags=#{node..map(&:name)}" { success: true, node_id: node_id, robot_id: htm.robot_id, robot_name: htm.robot_name, content: node.content, tags: node..map(&:name), created_at: node.created_at.iso8601 }.to_json end |