Skip to main content
Glama

control_lights

Control lighting on Opentrons Flex and OT-2 robots by turning lights on or off using the robot's IP address.

Instructions

Turn robot lights on or off

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
robot_ipYesRobot IP address
onYesTrue to turn lights on, false to turn off

Implementation Reference

  • The handler function that executes the tool logic by making a POST request to the robot's /robot/lights endpoint with the 'on' parameter.
    async controlLights(args) { const { robot_ip, on } = args; try { const body = { on }; const data = await this.makeApiRequest( 'POST', `http://${robot_ip}:31950/robot/lights`, { 'Content-Type': 'application/json' }, JSON.stringify(body) ); return { content: [ { type: "text", text: `✅ Lights turned ${on ? 'ON' : 'OFF'} successfully!` } ] }; } catch (error) { return { content: [ { type: "text", text: `❌ Failed to control lights: ${error.message}` } ] }; } }
  • The tool schema definition provided in the ListTools response, specifying name, description, and input schema.
    { name: "control_lights", description: "Turn robot lights on or off", inputSchema: { type: "object", properties: { robot_ip: { type: "string", description: "Robot IP address" }, on: { type: "boolean", description: "True to turn lights on, false to turn off" } }, required: ["robot_ip", "on"] } },
  • index.js:264-265 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement.
    case "control_lights": return this.controlLights(args);
  • API endpoint documentation for POST /robot/lights used by the control_lights tool.
    { method: "POST", path: "/robot/lights", summary: "Control lights", description: "Turn rail lights on or off", tags: ["Control"], requestBody: { required: true, properties: { on: { type: "boolean", description: "True to turn lights on, false to turn off" } } } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yerbymatey/opentrons-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server