Class: HTM::MCP::LeaveGroupTool
- Inherits:
-
FastMcp::Tool
- Object
- FastMcp::Tool
- HTM::MCP::LeaveGroupTool
- Defined in:
- lib/htm/mcp/group_tools.rb
Overview
Tool: Leave a robot group
Instance Method Summary collapse
Instance Method Details
#call(name:) ⇒ Object
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/htm/mcp/group_tools.rb', line 197 def call(name:) Session.logger&.info "LeaveGroupTool called: name=#{name.inspect}" group = GroupSession.get_group(name) unless group return { success: false, error: "Group '#{name}' not found in this session" }.to_json end robot_name = Session.robot_name unless group.member?(robot_name) return { success: false, error: "Robot '#{robot_name}' is not a member of group '#{name}'" }.to_json end group.remove(robot_name) Session.logger&.info "Robot #{robot_name} left group #{name}" { success: true, group_name: name, robot_name: robot_name, message: "Robot '#{robot_name}' left group '#{name}'" }.to_json end |