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" }
        }
      }
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the action ('turn') but does not disclose behavioral traits such as required permissions, whether the change is immediate or reversible, error handling, or effects on robot operation. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a mutation tool controlling hardware), lack of annotations, and no output schema, the description is incomplete. It does not address return values, error conditions, or operational constraints, leaving gaps for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('robot_ip' and 'on') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as format details or usage examples. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('turn') and resource ('robot lights') with the specific states ('on or off'). It distinguishes from most siblings (e.g., 'control_run', 'home_robot') but not explicitly from 'robot_health' which might involve light status. The purpose is specific but lacks differentiation from potential overlapping tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description does not mention prerequisites (e.g., robot connectivity), exclusions, or related tools like 'robot_health' that might check light status. Usage is implied by the action but without explicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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