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
| Name | Required | Description | Default |
|---|---|---|---|
| effect | Yes | Name of the effect to apply |
Implementation Reference
- src/index.ts:358-368 (handler)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'], }, }, - src/nanoleaf-client.ts:190-194 (helper)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 }); } - src/index.ts:122-131 (schema)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'], },