Skip to main content
Glama
madorn
by madorn

control_shades

Control motorized shades by opening, closing, or setting precise positions to manage light and privacy in smart homes.

Instructions

Control motorized shades.

Args: device_id: The Bond shade device identifier action: Action to perform ("open", "close", or "set_position") position: Position percentage (0-100) when action is "set_position"

Returns: Result of the shade control operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYes
actionYes
positionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'control_shades' MCP tool. It is decorated with @mcp.tool(), which also serves as the registration. Validates inputs and calls the Bond client to open, close, or set position of shades.
    @mcp.tool()
    async def control_shades(device_id: str, action: str, position: Optional[int] = None) -> Dict[str, Any]:
        """Control motorized shades.
        
        Args:
            device_id: The Bond shade device identifier
            action: Action to perform ("open", "close", or "set_position")
            position: Position percentage (0-100) when action is "set_position"
            
        Returns:
            Result of the shade control operation.
        """
        valid_actions = ["open", "close", "set_position"]
        if action.lower() not in valid_actions:
            return {"error": f"Action must be one of: {', '.join(valid_actions)}"}
        
        if action.lower() == "set_position" and (position is None or not (0 <= position <= 100)):
            return {"error": "Position must be between 0 and 100 when setting position"}
        
        try:
            async with await get_bond_client() as client:
                if action.lower() == "open":
                    result = await client.open_shades(device_id)
                elif action.lower() == "close":
                    result = await client.close_shades(device_id)
                else:  # set_position
                    result = await client.set_position(device_id, position)
                
                return {
                    "device_id": device_id,
                    "action": action.lower(),
                    "position": position if action.lower() == "set_position" else None,
                    "result": result
                }
        except BondAPIError as e:
            return {"error": f"Failed to control shades: {str(e)}"}
        except Exception as e:
            logger.error(f"Unexpected error controlling shades: {e}")
            return {"error": f"Unexpected error: {str(e)}"}
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the action types and position parameter, it doesn't describe what 'control' entails (e.g., whether it's immediate, requires authentication, has rate limits, or what happens on failure). For a mutation tool with zero annotation coverage, this 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 with a clear opening statement followed by well-organized Args and Returns sections. Every sentence earns its place by providing essential information without redundancy, making it easy to scan and understand.

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 the tool's moderate complexity (3 parameters, mutation operation) and the presence of an output schema (handling return values), the description is adequate but has gaps. It covers parameter semantics well but lacks behavioral context and usage guidelines, making it incomplete for optimal agent understanding despite the output schema assistance.

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 adds substantial value beyond the input schema, which has 0% description coverage. It explains that device_id is a 'Bond shade device identifier', clarifies that action accepts 'open', 'close', or 'set_position', and specifies that position is a 'percentage (0-100)' for set_position actions. This compensates well for the schema's lack of descriptions.

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 verb 'control' and resource 'motorized shades', making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'toggle_device_power' or 'send_custom_action' that might also affect shade devices, missing full sibling differentiation.

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. There's no mention of prerequisites (like needing device_id from list_devices), nor does it explain when to choose control_shades over send_custom_action for shade operations, leaving usage context unclear.

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/madorn/bond-mcp-server'

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