Add Lovelace resource
dashboards_add_dashboard_resourceRegisters a custom JS or CSS resource so it loads on every Lovelace dashboard page. Use it to make a custom card, theme, or script available across all dashboards.
Instructions
Register a custom JS or CSS resource that loads on every Lovelace dashboard page.
Sends url/resource_type to lovelace/resources/create, which
stores a new resource entry with a server-generated id — repeating
this call registers a second, distinct resource rather than updating
one. The tool itself only stores the URL string; it never fetches
url — the browser loads it later, from /local/ (incl. the
Marketplace's /local/community/), /hacsfiles/, or any external CDN
the URL names.
Use when: registering a custom card, theme, or script so it becomes
available on every dashboard.
Not for: changing an existing resource's URL/type — use
dashboards_update_dashboard_resource.
Returns: {"status": "added", "url": ..., "resource_type": ..., "result": ...} on success.
Errors: {"error": "resource_type must be 'module', 'js', or 'css'"}
when resource_type is anything else.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>"
},
"name": "dashboards_add_dashboard_resource"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Resource URL, e.g. '/local/my-card.js' or '/local/community/mini-graph-card/mini-graph-card-bundle.js' (Marketplace, HA 2026.11+; '/hacsfiles/...' with HACS before). | |
| resource_type | No | Resource kind: 'module' (ES module JS), 'js' (legacy script), or 'css'. Defaults to 'module'. | module |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||