Skip to main content
Glama
MCP-Domotica

MCP Domotica Backend

by MCP-Domotica

eliminar_habitacion

Remove a room from the smart home system. The room must be empty with all devices deleted first to complete the operation.

Instructions

Elimina una habitación del sistema.

Args: room_name: nombre de la habitación a eliminar

Returns: Confirmación de eliminación.

Restricciones: - La habitación debe estar vacía (sin dispositivos) - Primero deben eliminarse todos los dispositivos de la habitación

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_nameYes

Implementation Reference

  • The handler function for the 'eliminar_habitacion' MCP tool. It is decorated with @mcp.tool() for registration and schema inference from signature/docstring. Executes by calling storage.delete_room(room_name).
    @mcp.tool()
    def eliminar_habitacion(room_name: str) -> dict:
        """
        Elimina una habitación del sistema.
        
        Args:
            room_name: nombre de la habitación a eliminar
        
        Returns:
            Confirmación de eliminación.
        
        Restricciones:
            - La habitación debe estar vacía (sin dispositivos)
            - Primero deben eliminarse todos los dispositivos de la habitación
        """
        return storage.delete_room(room_name)
  • The core helper method in the storage class that performs the room deletion logic: validates emptiness, removes from storage, persists to JSON file.
    def delete_room(self, name: str) -> dict:
        """Elimina una habitación (debe estar vacía)."""
        self.reload()  # Sincronizar con archivo
        if name not in self.rooms:
            raise ValueError(f"Habitación '{name}' no existe")
        
        room = self.rooms[name]
        if room.devices:
            raise ValueError(
                f"No se puede eliminar habitación con dispositivos. "
                f"Eliminar primero: {room.devices}"
            )
        
        del self.rooms[name]
        self._save_to_file()
        return {"room": name, "status": "deleted"}
  • The function signature (room_name: str -> dict) and docstring define the input schema and output for the MCP tool.
    @mcp.tool()
    def eliminar_habitacion(room_name: str) -> dict:
        """
        Elimina una habitación del sistema.
        
        Args:
            room_name: nombre de la habitación a eliminar
        
        Returns:
            Confirmación de eliminación.
        
        Restricciones:
            - La habitación debe estar vacía (sin dispositivos)
            - Primero deben eliminarse todos los dispositivos de la habitación
        """
        return storage.delete_room(room_name)
  • The @mcp.tool() decorator registers this function as an MCP tool named 'eliminar_habitacion'.
    @mcp.tool()
    def eliminar_habitacion(room_name: str) -> dict:
        """
        Elimina una habitación del sistema.
        
        Args:
            room_name: nombre de la habitación a eliminar
        
        Returns:
            Confirmación de eliminación.
        
        Restricciones:
            - La habitación debe estar vacía (sin dispositivos)
            - Primero deben eliminarse todos los dispositivos de la habitación
        """
        return storage.delete_room(room_name)
Behavior3/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 clearly indicates this is a destructive operation ('Elimina') and specifies important constraints about room emptiness. However, it doesn't mention authentication requirements, potential side effects beyond deletion confirmation, error conditions, or rate limits. The description adds value beyond what structured fields would provide but doesn't fully compensate for the lack of annotations.

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

Conciseness5/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 with the core purpose. Every sentence earns its place: the opening statement defines the action, the Args section explains the parameter, Returns indicates the outcome, and Restricciones provides crucial usage constraints. No wasted words or redundant information.

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?

For a destructive operation with no annotations and no output schema, the description does well by specifying the action, parameter meaning, return confirmation, and important constraints. It covers the essential context needed to understand this tool's purpose and limitations. The main gap is the lack of detailed behavioral information about authentication, error handling, or what the confirmation actually contains.

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?

With 0% schema description coverage and only one parameter, the description provides essential semantic context: 'room_name' is 'nombre de la habitación a eliminar' (name of the room to delete). This clearly explains what the parameter represents. While it doesn't specify format constraints or examples, it successfully compensates for the complete lack of schema documentation for this single parameter.

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 the action ('Elimina' - deletes) and the resource ('una habitación del sistema'), making the purpose immediately understandable. It distinguishes from siblings like 'agregar_habitacion' (add), 'consultar_habitacion' (query), and 'modificar_habitacion' (modify) by specifying deletion rather than creation, retrieval, or updating. However, it doesn't explicitly contrast with these alternatives in the description text itself.

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

Usage Guidelines4/5

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

The 'Restricciones' section provides clear contextual guidance on when to use this tool: only when the room is empty (without devices) and after all devices have been removed first. This establishes important prerequisites for successful invocation. However, it doesn't explicitly mention when NOT to use it or name specific alternative tools for related operations.

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