Skip to main content
Glama

get_device_info

Retrieve detailed capabilities and properties for a specific Bond Bridge smart home device to enable precise control of fans, shades, lights, and other RF-controlled devices.

Instructions

Get detailed information about a specific device.

Args: device_id: The Bond device identifier

Returns: Detailed device information including capabilities and properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYes

Implementation Reference

  • MCP tool handler for 'get_device_info'. Fetches device information from BondClient and returns it with device_id.
    @mcp.tool() async def get_device_info(device_id: str) -> Dict[str, Any]: """Get detailed information about a specific device. Args: device_id: The Bond device identifier Returns: Detailed device information including capabilities and properties. """ try: async with await get_bond_client() as client: device_info = await client.get_device_info(device_id) return { "device_id": device_id, "info": device_info } except BondAPIError as e: return {"error": f"Failed to get device info: {str(e)}"} except Exception as e: logger.error(f"Unexpected error getting device info: {e}") return {"error": f"Unexpected error: {str(e)}"}
  • Registers the get_device_info function as an MCP tool using FastMCP decorator.
    @mcp.tool()
  • BondClient helper method that performs the actual API request to retrieve device information from the Bond Bridge.
    async def get_device_info(self, device_id: str) -> Dict[str, Any]: """Get detailed information about a specific device. Args: device_id: Device identifier Returns: Device information """ return await self._request("GET", f"devices/{device_id}")
  • Pydantic model defining the structure for DeviceInfo, imported and used in the codebase for type validation.
    class DeviceInfo(BaseModel): """Device information model.""" name: str type: DeviceType location: Optional[str] = None actions: List[ActionType] = Field(default_factory=list) properties: Dict[str, Any] = Field(default_factory=dict) state: Dict[str, Any] = Field(default_factory=dict) class Config: use_enum_values = True

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