Skip to main content
Glama
madorn
by madorn

set_light_brightness

Adjust dimmable light brightness levels by specifying a percentage value from 0 (off) to 100 (maximum) for Bond Bridge smart home devices.

Instructions

Set brightness for a dimmable light device.

Args: device_id: The Bond light device identifier brightness: Brightness percentage (0-100, where 0 is off)

Returns: Result of the brightness change operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYes
brightnessYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'set_light_brightness' tool. It is registered via the @mcp.tool() decorator. Validates input brightness, interacts with BondClient to dim or turn off the light, handles errors, and returns a result dictionary.
    @mcp.tool()
    async def set_light_brightness(device_id: str, brightness: int) -> Dict[str, Any]:
        """Set brightness for a dimmable light device.
        
        Args:
            device_id: The Bond light device identifier
            brightness: Brightness percentage (0-100, where 0 is off)
            
        Returns:
            Result of the brightness change operation.
        """
        if not (0 <= brightness <= 100):
            return {"error": "Brightness must be between 0 and 100"}
        
        try:
            async with await get_bond_client() as client:
                if brightness == 0:
                    result = await client.turn_off(device_id)
                    action = "turned off"
                else:
                    result = await client.dim_light(device_id, brightness)
                    action = f"set to {brightness}% brightness"
                
                return {
                    "device_id": device_id,
                    "brightness": brightness,
                    "action": action,
                    "result": result
                }
        except BondAPIError as e:
            return {"error": f"Failed to set light brightness: {str(e)}"}
        except Exception as e:
            logger.error(f"Unexpected error setting light brightness: {e}")
            return {"error": f"Unexpected error: {str(e)}"}
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 of behavioral disclosure. It implies a mutation operation ('Set brightness') and specifies the brightness range (0-100), but lacks details on permissions, rate limits, or side effects. It adds some context but falls short of fully describing behavioral traits.

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 appropriately sized and front-loaded, with a clear purpose statement followed by structured Arg and Return sections. Every sentence adds value without redundancy, making it efficient and easy to parse.

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

Completeness4/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 (2 parameters, mutation operation) and the presence of an output schema (which handles return values), the description is largely complete. It covers purpose and parameter semantics well but could improve by adding usage guidelines and more behavioral context, especially since annotations are absent.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains that device_id is a 'Bond light device identifier' and brightness is a 'percentage (0-100, where 0 is off)', clarifying semantics and constraints not present in the schema.

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 brightness') and target resource ('dimmable light device'), distinguishing it from sibling tools like set_fan_speed or toggle_device_power. It precisely defines what the tool does without being vague or tautological.

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 send_custom_action. It doesn't mention prerequisites, such as needing the device to be a dimmable light, or exclusions, leaving the agent to infer usage context.

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