get_bridge_info
Retrieve Bond Bridge device information including version, uptime, and configuration status for smart home device management.
Instructions
Get Bond Bridge information and status.
Returns: Bridge information including version, uptime, and configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/bond_mcp/server.py:323-346 (handler)The primary handler function for the 'get_bridge_info' MCP tool. Decorated with @mcp.tool(), it fetches bridge information from the Bond Bridge via BondClient and includes server configuration.@mcp.tool() async def get_bridge_info() -> Dict[str, Any]: """Get Bond Bridge information and status. Returns: Bridge information including version, uptime, and configuration. """ try: async with await get_bond_client() as client: bridge_info = await client.get_bridge_info() return { "bridge": bridge_info, "server_config": { "host": config.bond_host, "timeout": config.timeout, "max_retries": config.max_retries } } except BondAPIError as e: return {"error": f"Failed to get bridge info: {str(e)}"} except Exception as e: logger.error(f"Unexpected error getting bridge info: {e}") return {"error": f"Unexpected error: {str(e)}"}
- src/bond_mcp/bond_client.py:100-102 (helper)Supporting method in BondClient class that makes an HTTP GET request to the Bond Bridge root endpoint ('') to retrieve raw bridge information.async def get_bridge_info(self) -> Dict[str, Any]: """Get Bond Bridge information.""" return await self._request("GET", "")
- src/bond_mcp/models.py:80-91 (schema)Pydantic model defining the expected structure of Bond Bridge information data, used for validation and typing in the codebase.class BridgeInfo(BaseModel): """Bond Bridge information model.""" name: str location: Optional[str] = None bluelight: Optional[bool] = None mac: Optional[str] = None fw_ver: Optional[str] = None hw_ver: Optional[str] = None uptime_s: Optional[int] = None api: Optional[str] = None target: Optional[str] = None
- src/bond_mcp/server.py:348-357 (registration)The main() function that initializes and runs the MCP server with mcp.run(), which automatically registers all decorated tools including get_bridge_info.def main(): """Main entry point for the Bond MCP server.""" logger.info(f"Starting Bond MCP Server v{config.server_version}") logger.info(f"Connecting to Bond Bridge at {config.bond_host}") # Configure logging level logging.getLogger().setLevel(getattr(logging, config.log_level)) # Run the FastMCP server mcp.run()