Skip to main content
Glama
kaeljune

Fibaro HC3 MCP Server

by kaeljune

fibaro_get_scene

Retrieve a specific scene by its ID from Fibaro Home Center 3 to manage smart home automation sequences.

Instructions

Get specific scene by ID from Fibaro HC3

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesScene ID

Implementation Reference

  • MCP server handler for the fibaro_get_scene tool. Checks Fibaro connection, retrieves the specific scene using FibaroClient.getScene, formats and returns the scene details as text content.
    case 'fibaro_get_scene': {
      if (!this.fibaroClient) {
        throw new Error('Not connected to Fibaro HC3. Please check your configuration and restart the MCP server.');
      }
      const scene = await this.fibaroClient.getScene(args?.id as number);
      return {
        content: [
          {
            type: 'text',
            text: `Scene ${scene.id}:\nName: ${scene.name}\nRoom ID: ${scene.roomID}\nEnabled: ${scene.enabled}\nVisible: ${scene.visible}\nIs Lua: ${scene.isLua}`,
          },
        ],
      };
    }
  • src/index.ts:142-155 (registration)
    Registration of the fibaro_get_scene tool in the ListTools response, including name, description, and input schema requiring a scene ID.
    {
      name: 'fibaro_get_scene',
      description: 'Get specific scene by ID from Fibaro HC3',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'number',
            description: 'Scene ID',
          },
        },
        required: ['id'],
      },
    },
  • TypeScript interface defining the structure of a Scene object, used as the return type for getScene.
    export interface Scene {
      id: number;
      name: string;
      roomID: number;
      enabled: boolean;
      visible: boolean;
      isLua: boolean;
    }
  • FibaroClient helper method that makes an HTTP GET request to the Fibaro API endpoint /api/scenes/{id} to fetch the specific scene data.
    async getScene(id: number): Promise<Scene> {
      try {
        const response = await this.client.get(`/api/scenes/${id}`);
        return response.data;
      } catch (error) {
        throw new Error(`Failed to get scene ${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