Skip to main content
Glama

set_fan_direction

Control ceiling fan airflow direction to optimize comfort and energy efficiency. Change fan rotation between forward (cooling) and reverse (winter) modes for your Bond Bridge device.

Instructions

Set fan direction for a ceiling fan device.

Args: device_id: The Bond fan device identifier direction: Fan direction ("forward" or "reverse")

Returns: Result of the direction change operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYes
directionYes

Implementation Reference

  • The complete implementation of the 'set_fan_direction' tool handler, including the @mcp.tool() decorator for automatic registration in FastMCP. It validates the direction input, maps 'forward'/'reverse' to 1/-1, calls BondClient.set_direction, and handles errors.
    @mcp.tool() async def set_fan_direction(device_id: str, direction: str) -> Dict[str, Any]: """Set fan direction for a ceiling fan device. Args: device_id: The Bond fan device identifier direction: Fan direction ("forward" or "reverse") Returns: Result of the direction change operation. """ direction_map = {"forward": 1, "reverse": -1} if direction.lower() not in direction_map: return {"error": "Direction must be 'forward' or 'reverse'"} try: async with await get_bond_client() as client: dir_value = direction_map[direction.lower()] result = await client.set_direction(device_id, dir_value) return { "device_id": device_id, "direction": direction.lower(), "result": result } except BondAPIError as e: return {"error": f"Failed to set fan direction: {str(e)}"} except Exception as e: logger.error(f"Unexpected error setting fan direction: {e}") return {"error": f"Unexpected error: {str(e)}"}

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