Skip to main content
Glama
madorn
by madorn

set_fan_speed

Control ceiling fan speed levels from 0 (off) to 8 using the Bond Bridge smart home system. Adjust fan operation for comfort and energy efficiency.

Instructions

Set fan speed for a ceiling fan device.

Args: device_id: The Bond fan device identifier speed: Fan speed level (0-8, where 0 is off)

Returns: Result of the speed change operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYes
speedYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function for the 'set_fan_speed' MCP tool. It performs input validation, interacts with the Bond client to set the fan speed, and handles errors appropriately.
    @mcp.tool()
    async def set_fan_speed(device_id: str, speed: int) -> Dict[str, Any]:
        """Set fan speed for a ceiling fan device.
        
        Args:
            device_id: The Bond fan device identifier
            speed: Fan speed level (0-8, where 0 is off)
            
        Returns:
            Result of the speed change operation.
        """
        if not (0 <= speed <= 8):
            return {"error": "Fan speed must be between 0 and 8"}
        
        try:
            async with await get_bond_client() as client:
                result = await client.set_speed(device_id, speed)
                return {
                    "device_id": device_id,
                    "speed": speed,
                    "action": "off" if speed == 0 else f"set to speed {speed}",
                    "result": result
                }
        except BondAPIError as e:
            return {"error": f"Failed to set fan speed: {str(e)}"}
        except Exception as e:
            logger.error(f"Unexpected error setting fan speed: {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 implies a mutation operation ('Set'), it doesn't disclose whether this requires authentication, has side effects, is idempotent, has rate limits, or what happens with invalid inputs. The return statement is vague about what 'Result' contains.

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

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with clear sections (purpose, args, returns). The first sentence states the core purpose, and subsequent sections add necessary detail. While efficient, the 'Returns' section could be more specific about what 'Result' entails.

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?

For a mutation tool with no annotations but with an output schema, the description provides adequate basic information about purpose and parameters. However, it lacks important behavioral context about side effects, error handling, and authentication requirements that would be expected for a device control operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing complete semantic information for both parameters. It explains device_id is a 'Bond fan device identifier' and speed is a 'Fan speed level (0-8, where 0 is off)', adding crucial context beyond the bare schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Set fan speed') and target resource ('for a ceiling fan device'), distinguishing it from sibling tools like set_fan_direction or set_light_brightness. It provides a complete verb+resource+scope statement that leaves no ambiguity about what this tool does.

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 like toggle_device_power or set_fan_direction. It doesn't mention prerequisites, error conditions, or contextual constraints, leaving the agent with no usage differentiation from sibling tools.

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