Skip to main content
Glama

consultar_habitacion

Retrieve detailed information about a specific smart home room, including all connected devices and their current status for home automation management.

Instructions

Obtiene información detallada de una habitación específica.

Args: room_name: nombre de la habitación

Returns: Información completa de la habitación incluyendo todos sus dispositivos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_nameYes

Implementation Reference

  • The main handler function for the 'consultar_habitacion' MCP tool, decorated with @mcp.tool(). It takes room_name as input and delegates to storage.get_room_info() for the logic.
    @mcp.tool() def consultar_habitacion(room_name: str) -> dict: """ Obtiene información detallada de una habitación específica. Args: room_name: nombre de la habitación Returns: Información completa de la habitación incluyendo todos sus dispositivos. """ return storage.get_room_info(room_name)
  • Supporting utility method in the storage module that implements the core logic for retrieving detailed information about a specific room, including its devices and counts of certain types.
    def get_room_info(self, name: str) -> dict: """Obtiene información detallada de una habitación.""" self.reload() # Sincronizar con archivo if name not in self.rooms: raise ValueError(f"Habitación '{name}' no existe") room = self.rooms[name] devices = [self.devices[dev_id].to_dict() for dev_id in room.devices] lights = sum(1 for d in devices if d["type"] == "light") thermos = sum(1 for d in devices if d["type"] == "thermostat") return { "room": name, "type": room.type, "devices": devices, "light_count": lights, "thermostat_count": thermos }

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