Skip to main content
Glama
MCP-Domotica

MCP Domotica Backend

by MCP-Domotica

modificar_habitacion

Change the name of an existing smart home room and automatically update all associated devices with the new room name for consistent home automation management.

Instructions

Modifica el nombre de una habitación existente. Actualiza automáticamente todos los dispositivos asociados.

Args: old_name: nombre actual de la habitación new_name: nuevo nombre para la habitación

Returns: Confirmación con ambos nombres (antiguo y nuevo).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
old_nameYes
new_nameYes

Implementation Reference

  • The MCP tool handler function for 'modificar_habitacion'. It invokes the storage layer to update the room name and associated devices.
    @mcp.tool()
    def modificar_habitacion(old_name: str, new_name: str) -> dict:
        """
        Modifica el nombre de una habitación existente.
        Actualiza automáticamente todos los dispositivos asociados.
        
        Args:
            old_name: nombre actual de la habitación
            new_name: nuevo nombre para la habitación
        
        Returns:
            Confirmación con ambos nombres (antiguo y nuevo).
        """
        return storage.update_room(old_name, new_name)
  • Supporting method in the storage class that implements the room renaming logic, including validation, updating device room assignments, and persisting changes to JSON file.
    def update_room(self, old_name: str, new_name: str) -> dict:
        """Renombra una habitación y actualiza sus dispositivos."""
        self.reload()  # Sincronizar con archivo
        if old_name not in self.rooms:
            raise ValueError(f"Habitación '{old_name}' no existe")
        if new_name in self.rooms and new_name != old_name:
            raise ValueError(f"Habitación '{new_name}' ya existe")
        
        room = self.rooms.pop(old_name)
        room.name = new_name
        self.rooms[new_name] = room
        
        # Actualizar room en dispositivos
        for device_id in room.devices:
            self.devices[device_id].room = new_name
        
        self._save_to_file()
        return {"old_name": old_name, "new_name": new_name, "status": "updated"}
  • The @mcp.tool() decorator registers the modificar_habitacion function as an MCP tool.
    @mcp.tool()
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. It discloses that the tool modifies an existing room's name and automatically updates associated devices, which is useful behavioral context. However, it doesn't mention permissions needed, whether the operation is reversible, error conditions (e.g., if old_name doesn't exist or new_name conflicts), or rate limits. The description adds value but leaves significant behavioral gaps.

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 efficiently structured: a clear purpose statement, followed by a behavioral note (automatic device updates), then separate Args and Returns sections. Every sentence adds value, with no redundant or vague language. It's appropriately sized for a simple update tool.

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

Completeness3/5

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

Given no annotations and no output schema, the description does a decent job: it explains the tool's purpose, parameters, and return confirmation. However, for a mutation tool, it lacks details on permissions, error handling, and the format of the return confirmation. It's minimally viable but has clear gaps in behavioral context.

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 description explicitly documents both parameters (old_name, new_name) with clear semantics in the Args section, despite 0% schema description coverage. It explains what each parameter represents, compensating fully for the schema's lack of descriptions. Since there are only 2 parameters and both are well-explained, this earns a high score.

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 tool's purpose: 'Modifica el nombre de una habitación existente' (Modifies the name of an existing room). It specifies the verb (modify/update) and resource (room name), but doesn't explicitly differentiate from sibling tools like 'agregar_habitacion' (add room) or 'eliminar_habitacion' (delete room) beyond the different action verbs.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., room must exist), exclusions, or compare it to sibling tools like 'consultar_habitacion' (query room) or 'eliminar_habitacion' (delete room). The agent must infer usage from the tool name and description alone.

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