fibaro_get_rooms
Retrieve all room information from your Fibaro Home Center 3 smart home system to organize and manage devices by location.
Instructions
Get all rooms from Fibaro HC3
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:402-417 (handler)MCP tool handler for 'fibaro_get_rooms' that checks Fibaro connection, calls client.getRooms(), formats and returns the list of rooms.case 'fibaro_get_rooms': { if (!this.fibaroClient) { throw new Error('Not connected to Fibaro HC3. Please check your configuration and restart the MCP server.'); } const rooms = await this.fibaroClient.getRooms(); return { content: [ { type: 'text', text: `Found ${rooms.length} rooms:\n\n${rooms .map(r => `ID: ${r.id} - ${r.name} - Section: ${r.sectionID}`) .join('\n')}`, }, ], }; }
- src/fibaro-client.ts:31-35 (schema)TypeScript interface defining the Room object structure used in the tool's output.export interface Room { id: number; name: string; sectionID: number; }
- src/index.ts:156-163 (registration)Tool registration in ListTools handler, including name, description, and input schema (no parameters required).{ name: 'fibaro_get_rooms', description: 'Get all rooms from Fibaro HC3', inputSchema: { type: 'object', properties: {}, }, },
- src/fibaro-client.ts:105-112 (helper)FibaroClient helper method that performs the actual API GET request to '/api/rooms' to fetch rooms data.async getRooms(): Promise<Room[]> { try { const response = await this.client.get('/api/rooms'); return response.data; } catch (error) { throw new Error(`Failed to get rooms: ${error}`); } }