Skip to main content
Glama
MCP-Domotica

MCP Domotica Backend

by MCP-Domotica

agregar_habitacion

Add a new room to your smart home system by specifying its type (dining room, kitchen, bathroom, living room, or bedroom). The system automatically names and tracks rooms, supporting up to six total rooms for device management.

Instructions

Crea una nueva habitación en el sistema.

Args: room_type: tipo de habitación (comedor, cocina, baño, living, dormitorio)

Returns: Confirmación de creación con el nombre generado de la habitación.

Restricciones: - Máximo 6 habitaciones en el sistema - Solo tipos permitidos: comedor, cocina, baño, living, dormitorio - El sistema numera automáticamente (ej: si ya existe "dormitorio", crea "dormitorio 2")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_typeYes

Implementation Reference

  • MCP tool handler and registration for 'agregar_habitacion'. Defines the tool function signature (schema), docstring with validation details, and delegates execution to storage.add_room.
    @mcp.tool()
    def agregar_habitacion(room_type: str) -> dict:
        """
        Crea una nueva habitación en el sistema.
        
        Args:
            room_type: tipo de habitación (comedor, cocina, baño, living, dormitorio)
        
        Returns:
            Confirmación de creación con el nombre generado de la habitación.
        
        Restricciones:
            - Máximo 6 habitaciones en el sistema
            - Solo tipos permitidos: comedor, cocina, baño, living, dormitorio
            - El sistema numera automáticamente (ej: si ya existe "dormitorio", crea "dormitorio 2")
        """
        return storage.add_room(room_type)
  • Supporting utility method in storage class that implements the core room addition logic: validates room limits and type, generates unique room name, persists the new Room object to JSON file.
    def add_room(self, room_type: str) -> dict:
        """Crea una nueva habitación."""
        self.reload()  # Sincronizar con archivo
        if len(self.rooms) >= self.MAX_ROOMS:
            raise ValueError(f"Máximo {self.MAX_ROOMS} habitaciones")
        
        # Validar que el tipo sea permitido
        if room_type not in self.ALLOWED_ROOM_TYPES:
            raise ValueError(f"Tipo de habitación '{room_type}' no válido. Tipos permitidos: {', '.join(self.ALLOWED_ROOM_TYPES)}")
        
        # Generar nombre único con numeración
        count = sum(1 for room in self.rooms.values() if room.type == room_type)
        if count == 0:
            room_name = room_type
        else:
            room_name = f"{room_type} {count + 1}"
        
        self.rooms[room_name] = Room(name=room_name, type=room_type)
        self._save_to_file()
        return {"room": room_name, "type": room_type, "status": "created"}
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it creates a new room, enforces a maximum of 6 rooms, restricts to specific room types, and automatically numbers rooms (e.g., 'dormitorio 2'). It also mentions the return confirmation with generated name. This covers mutation effects, constraints, and output behavior well for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns, Restricciones) and front-loaded purpose. Each sentence adds value: the first states the action, and subsequent sections explain parameters, output, and constraints without redundancy. It could be slightly more concise by integrating sections, but overall it's efficient and organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (creation with constraints), no annotations, no output schema, and low schema coverage, the description does a good job of providing context. It covers purpose, parameters, returns, and behavioral restrictions. However, it lacks details on error conditions (e.g., what happens if max rooms exceeded) or system interactions, leaving minor gaps for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It adds significant meaning: it explains that 'room_type' is the type of room, lists allowed values (comedor, cocina, baño, living, dormitorio), and implies it's required for creation. This provides clear semantics beyond the bare schema, though it doesn't detail format or validation beyond the list.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Crea una nueva habitación en el sistema' (Creates a new room in the system), which is a specific verb+resource combination. It distinguishes from siblings like consultar_habitacion (query), eliminar_habitacion (delete), and modificar_habitacion (modify) by focusing on creation. However, it doesn't explicitly differentiate from other potential creation tools beyond the room context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through the creation purpose and lists restrictions like maximum 6 rooms and allowed types, which provide some context for when to use it. However, it doesn't explicitly state when to use this tool versus alternatives (e.g., modificar_habitacion for updates) or mention prerequisites like system state. The guidelines are present but not comprehensive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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