set_effect
Apply a specific lighting effect to Nanoleaf smart lights using the MCP server. Input the effect name to instantly enhance or change the ambient lighting setup.
Instructions
Set an effect on the Nanoleaf lights
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| effect | Yes | Name of the effect to apply |
Input Schema (JSON Schema)
{
"properties": {
"effect": {
"description": "Name of the effect to apply",
"type": "string"
}
},
"required": [
"effect"
],
"type": "object"
}
Implementation Reference
- src/index.ts:358-368 (handler)MCP tool handler for 'set_effect': extracts effect name from arguments, calls primaryDevice.setEffect(effect), and returns 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:122-130 (schema)Input schema for 'set_effect' tool defining required 'effect' string parameter.inputSchema: { type: 'object', properties: { effect: { type: 'string', description: 'Name of the effect to apply', }, }, required: ['effect'],
- src/index.ts:119-132 (registration)Registration of 'set_effect' tool in ListToolsRequestHandler response, including name, description, and input schema.{ 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 setEffect in NanoleafClient class: sends PUT request to /effects endpoint with {select: effectName}.async setEffect(effectName: string): Promise<void> { await this.httpClient.put(this.getAuthUrl('/effects'), { select: effectName }); }