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
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | Yes |
Implementation Reference
- src/bond_mcp/server.py:73-94 (handler)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)}"}
- src/bond_mcp/server.py:73-73 (registration)Registers the get_device_info function as an MCP tool using FastMCP decorator.@mcp.tool()
- src/bond_mcp/bond_client.py:108-117 (helper)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}")
- src/bond_mcp/models.py:39-50 (schema)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