Class: HTM::MCP::SetRobotTool

Inherits:
FastMcp::Tool
  • Object
show all
Defined in:
lib/htm/mcp/tools.rb

Overview

Tool: Set the robot identity for this session

Instance Method Summary collapse

Instance Method Details

#call(name:) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/htm/mcp/tools.rb', line 44

def call(name:)
  Session.logger&.info "SetRobotTool called: name=#{name.inspect}"

  htm   = Session.set_robot(name)
  robot = HTM::Models::Robot[htm.robot_id]

  {
    success:    true,
    robot_id:   htm.robot_id,
    robot_name: htm.robot_name,
    node_count: robot.node_count,
    message:    "Robot '#{name}' is now active for this session"
  }.to_json
end