dashboards_get_dashboard_resources
Get Lovelace dashboard resources such as custom cards and CSS for managing your Home Assistant interface.
Instructions
Get Lovelace resources (custom cards, CSS).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- tools/dashboards.py:42-45 (handler)Handler for dashboards_get_dashboard_resources tool. Decorated as @mcp.tool() on a FastMCP instance named 'dashboards'. Calls ha._ws_call('lovelace/resources') to fetch Lovelace resources (custom cards, CSS) via WebSocket.
@mcp.tool() def get_dashboard_resources() -> list[dict]: """Get Lovelace resources (custom cards, CSS).""" return ha._ws_call("lovelace/resources") - tools/dashboards.py:4-4 (registration)FastMCP instance registration; the @mcp.tool() decorator registers get_dashboard_resources under the 'dashboards' MCP server.
mcp = FastMCP("dashboards") - ha_client.py:59-66 (helper)Helper function _ws_call that the handler delegates to; sends 'lovelace/resources' WebSocket message to Home Assistant.
def _ws_call(msg_type: str, **kwargs) -> Any: try: asyncio.get_running_loop() except RuntimeError: return asyncio.run(_ws_call_async(msg_type, **kwargs)) import concurrent.futures with concurrent.futures.ThreadPoolExecutor() as pool: return pool.submit(asyncio.run, _ws_call_async(msg_type, **kwargs)).result()