Skip to main content
Glama

set_light_brightness

Adjust dimmable light brightness levels through the Bond MCP Server by specifying device ID and percentage (0-100). Control smart lighting devices by setting precise brightness values for customized illumination.

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

Implementation Reference

  • The main handler function for the 'set_light_brightness' tool. Decorated with @mcp.tool() for registration in FastMCP. Validates input, interacts with Bond client to dim light or turn off, and returns result or error.
    @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)}"}

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