Skip to main content
Glama

consultar_habitaciones

Retrieve a complete list of rooms with their device counts by type to manage your smart home setup.

Instructions

Obtiene la lista completa de habitaciones con su información.

Returns: Lista de habitaciones con nombre y cantidad de dispositivos por tipo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler decorated with @mcp.tool(). Executes by calling storage.list_rooms() to return the list of rooms with device counts.
    def consultar_habitaciones() -> list[dict]: """ Obtiene la lista completa de habitaciones con su información. Returns: Lista de habitaciones con nombre y cantidad de dispositivos por tipo. """ return storage.list_rooms()
  • Core helper method in DomoticaStorage that lists all rooms, counts devices by type for each room, and returns structured data.
    def list_rooms(self) -> list[dict]: """Lista todas las habitaciones con estadísticas.""" self.reload() # Sincronizar con archivo result = [] for room in self.rooms.values(): lights = sum(1 for d in room.devices if self.devices[d].type == "light") thermos = sum(1 for d in room.devices if self.devices[d].type == "thermostat") fans = sum(1 for d in room.devices if self.devices[d].type == "fan") ovens = sum(1 for d in room.devices if self.devices[d].type == "oven") result.append({ "name": room.name, "type": room.type, "light_count": lights, "thermostat_count": thermos, "fan_count": fans, "oven_count": ovens, "total_devices": len(room.devices) }) return result

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/CrisDeCrisis/mcp-domotica-backend'

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