fibaro_get_device
Retrieve detailed information about a specific smart device by its ID from Fibaro Home Center 3. Enables precise device monitoring and control within the Fibaro HC3 MCP Server ecosystem.
Instructions
Get specific device by ID from Fibaro HC3
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Device ID |
Implementation Reference
- src/index.ts:120-133 (registration)Registration of the 'fibaro_get_device' tool in the ListTools response, including its description and input schema.{ name: 'fibaro_get_device', description: 'Get specific device by ID from Fibaro HC3', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, }, required: ['id'], }, },
- src/index.ts:355-368 (handler)The main handler for the 'fibaro_get_device' tool in the CallToolRequest switch statement. It calls FibaroClient.getDevice and formats the response.case 'fibaro_get_device': { if (!this.fibaroClient) { throw new Error('Not connected to Fibaro HC3. Please check your configuration and restart the MCP server.'); } const device = await this.fibaroClient.getDevice(args?.id as number); return { content: [ { type: 'text', text: `Device ${device.id}:\nName: ${device.name}\nType: ${device.type}\nRoom ID: ${device.roomID}\nEnabled: ${device.enabled}\nVisible: ${device.visible}\nProperties: ${JSON.stringify(device.properties, null, 2)}`, }, ], }; }
- src/fibaro-client.ts:78-85 (helper)The helper method in FibaroClient that performs the actual API call to retrieve a specific device by ID from the Fibaro HC3.async getDevice(id: number): Promise<Device> { try { const response = await this.client.get(`/api/devices/${id}`); return response.data; } catch (error) { throw new Error(`Failed to get device ${id}: ${error}`); } }
- src/index.ts:123-132 (schema)Input schema definition for the 'fibaro_get_device' tool, specifying the required 'id' parameter.inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'Device ID', }, }, required: ['id'], },