Skip to main content
Glama

set_effect

Apply visual effects to Nanoleaf smart lights by specifying effect names, enabling dynamic lighting control through the MCP server.

Instructions

Set an effect on the Nanoleaf lights

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
effectYesName of the effect to apply

Implementation Reference

  • Executes the 'set_effect' tool call by extracting the effect argument and delegating to the NanoleafClient's setEffect method, then returns a success message.
    case 'set_effect': const effect = request.params.arguments?.effect as string; await primaryDevice.setEffect(effect); return { content: [ { type: 'text', text: `Effect set to: ${effect}`, }, ], };
  • src/index.ts:119-132 (registration)
    Registers the 'set_effect' tool in the list of available tools, including its name, description, and input schema requiring an 'effect' string.
    { name: 'set_effect', description: 'Set an effect on the Nanoleaf lights', inputSchema: { type: 'object', properties: { effect: { type: 'string', description: 'Name of the effect to apply', }, }, required: ['effect'], }, },
  • Core implementation of setting an effect by sending a PUT request to the Nanoleaf API's /effects endpoint with the selected effect name.
    async setEffect(effectName: string): Promise<void> { await this.httpClient.put(this.getAuthUrl('/effects'), { select: effectName }); }
  • Defines the input schema for the 'set_effect' tool, specifying a required 'effect' parameter of type string.
    inputSchema: { type: 'object', properties: { effect: { type: 'string', description: 'Name of the effect to apply', }, }, required: ['effect'], },

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