Skip to main content
Glama

set_fan_direction

Control ceiling fan airflow direction to optimize cooling or heating efficiency. Change fan rotation between forward and reverse modes for seasonal comfort.

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 @mcp.tool() decorator registers this async function as the MCP tool handler for 'set_fan_direction'. It validates the direction input, maps it to 1 or -1, calls BondClient.set_direction, and returns the result or error.
    @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