get_nanoleaf_info
Retrieve device information from Nanoleaf smart lights to check status, connectivity, and available features for control.
Instructions
Get information about the Nanoleaf device
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_nanoleaf_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:301-309 (handler)MCP tool handler for 'get_nanoleaf_info' that calls primaryDevice.getInfo() and returns the JSON-stringified device information.
case 'get_nanoleaf_info': return { content: [ { type: 'text', text: JSON.stringify(await primaryDevice.getInfo(), null, 2), }, ], }; - src/index.ts:58-64 (registration)Registration of the 'get_nanoleaf_info' tool in the ListToolsRequestHandler, defining its name, description, and empty input schema.
name: 'get_nanoleaf_info', description: 'Get information about the Nanoleaf device', inputSchema: { type: 'object', properties: {}, }, }, - src/nanoleaf-client.ts:13-50 (schema)TypeScript interface defining the structure of the NanoleafInfo response object returned by the tool.
export interface NanoleafInfo { name: string; serialNo: string; manufacturer: string; firmwareVersion: string; model: string; state: { on: { value: boolean; }; brightness: { value: number; max: number; min: number; }; hue: { value: number; max: number; min: number; }; sat: { value: number; max: number; min: number; }; ct: { value: number; max: number; min: number; }; colorMode: string; }; effects: { select: string; effectsList: string[]; }; panelLayout: any; } - src/nanoleaf-client.ts:151-154 (helper)Core implementation of getInfo() in NanoleafClient class, which performs an authenticated GET request to the Nanoleaf API root endpoint and returns the device info.
async getInfo(): Promise<NanoleafInfo> { const response = await this.httpClient.get(this.getAuthUrl('')); return response.data; }