Skip to main content
Glama
kaeljune

Fibaro HC3 MCP Server

by kaeljune

fibaro_get_device

Retrieve a specific smart home device by its ID from the Fibaro Home Center 3 system to access device details and status.

Instructions

Get specific device by ID from Fibaro HC3

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesDevice ID

Implementation Reference

  • MCP tool handler for 'fibaro_get_device' that checks connection, calls FibaroClient.getDevice, and formats the response as text content.
    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/index.ts:120-133 (registration)
    Tool registration in ListTools handler, including name, description, and input schema requiring 'id'.
    {
      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'],
      },
    },
  • TypeScript interface defining the Device structure returned by getDevice.
    export interface Device {
      id: number;
      name: string;
      type: string;
      roomID: number;
      enabled: boolean;
      visible: boolean;
      properties: Record<string, any>;
    }
  • Core implementation of device retrieval via HTTP GET to Fibaro API /api/devices/{id}, using Axios client.
    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}`);
      }
    }

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/kaeljune/fibaro-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server