get_device_list
Retrieve all connected LG ThinQ devices to monitor status and access control capabilities through the ThinQ Connect platform.
Instructions
Retrieves a list of all devices connected to the ThinQ Connect platform Args: None
Returns:
String containing connected device list information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- thinqconnect_mcp/server.py:64-75 (registration)Registration of the 'get_device_list' MCP tool handler. This function is decorated with @mcp.tool and delegates execution to the tools module.@mcp.tool( description="""Retrieves a list of all devices connected to the ThinQ Connect platform Args: None Returns: String containing connected device list information """ ) async def get_device_list() -> str: return await tools.get_device_list(thinq_api=thinq_api)
- thinqconnect_mcp/tools.py:84-109 (handler)The core handler function that implements the logic for retrieving and formatting the device list from the ThinQ API, including caching.async def get_device_list(thinq_api: ThinQApi) -> List[str]: """ Get device list """ global local_device_lists try: thinq_api._session = ClientSession() if not local_device_lists: devices = await thinq_api.async_get_device_list() local_device_lists = devices else: devices = local_device_lists device_info = [] for device in devices: device_info.append( f"Device ID: {device.get('deviceId')}\n" f"Device Name: {device.get('deviceInfo').get('alias')}\n" f"Device Type: {device.get('deviceInfo').get('deviceType')}\n" f"Model Name: {device.get('deviceInfo').get('modelName')}\n" ) header = f"Found {len(devices)} devices:\n\n" return header + "\n".join(device_info) except Exception as e: return f"An error occurred while retrieving device list: {str(e)}"