Skip to main content
Glama

set_color

Change Nanoleaf smart light colors by specifying hue and saturation values to customize lighting ambiance in any space.

Instructions

Set the color of the Nanoleaf lights

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hueYesHue value (0-360)
saturationYesSaturation value (0-100)

Implementation Reference

  • MCP server handler for 'set_color' tool: extracts hue and saturation arguments and calls NanoleafClient.setColor method
    case 'set_color':
      const hue = request.params.arguments?.hue as number;
      const saturation = request.params.arguments?.saturation as number;
      await primaryDevice.setColor(hue, saturation);
      return {
        content: [
          {
            type: 'text',
            text: `Color set to hue: ${hue}, saturation: ${saturation}`,
          },
        ],
      };
  • Input schema defining required hue (0-360) and saturation (0-100) parameters for the set_color tool
    inputSchema: {
      type: 'object',
      properties: {
        hue: {
          type: 'number',
          description: 'Hue value (0-360)',
          minimum: 0,
          maximum: 360,
        },
        saturation: {
          type: 'number',
          description: 'Saturation value (0-100)',
          minimum: 0,
          maximum: 100,
        },
      },
      required: ['hue', 'saturation'],
    },
  • src/index.ts:97-118 (registration)
    Registration of the 'set_color' tool in the ListTools response, including name, description, and schema
    {
      name: 'set_color',
      description: 'Set the color of the Nanoleaf lights',
      inputSchema: {
        type: 'object',
        properties: {
          hue: {
            type: 'number',
            description: 'Hue value (0-360)',
            minimum: 0,
            maximum: 360,
          },
          saturation: {
            type: 'number',
            description: 'Saturation value (0-100)',
            minimum: 0,
            maximum: 100,
          },
        },
        required: ['hue', 'saturation'],
      },
    },
  • NanoleafClient helper method implementing the actual HTTP API call to set hue and saturation on the device state
    async setColor(hue: number, saturation: number): Promise<void> {
      if (hue < 0 || hue > 360) {
        throw new Error('Hue must be between 0 and 360');
      }
      if (saturation < 0 || saturation > 100) {
        throw new Error('Saturation must be between 0 and 100');
      }
      await this.httpClient.put(this.getAuthUrl('/state'), {
        hue: { value: hue },
        sat: { value: saturation }
      });
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Set' implies a mutation operation, but the description doesn't mention whether this requires authentication, what happens if lights are off, rate limits, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every word earning its place. No structural issues or redundancy are present.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, error handling, or what happens on success. For a tool that changes device state, more context is needed for safe and effective use.

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%, with hue and saturation parameters fully documented in the schema (including ranges and descriptions). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 where the 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 ('Set') and target resource ('color of the Nanoleaf lights'), making the purpose immediately understandable. It distinguishes this from siblings like set_brightness or set_effect by specifying color manipulation. However, it doesn't explicitly contrast with all siblings, so it's not a perfect 5.

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?

The description provides no guidance on when to use this tool versus alternatives like set_effect or set_brightness. It doesn't mention prerequisites (e.g., lights must be on or connected) or exclusions. Without any usage context, the agent must infer when this tool is appropriate.

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/srnetadmin/nanoleaf-mcp-server'

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