Skip to main content
Glama

Add card to dashboard view

dashboards_add_card_to_view

Append a Lovelace card to a specific view in a Home Assistant dashboard, then save the whole config. Use for masonry or panel views, not sections.

Instructions

Append a card to one view's cards list and save the whole dashboard.

Reads the dashboard via dashboards_get_dashboard_config, appends card_config to views[view_index]["cards"] (creating that key if absent), and writes the whole dashboard back with dashboards_save_dashboard_config — every other view and card is round-tripped unchanged.

Use when: adding a card to a masonry/panel view. Not for: a type: sections view — there, cards in view.cards render only in edit mode; use dashboards_add_card_to_section instead. Returns: {"status": "saved", "url_path": ...} from the underlying save. Errors: raises ValueError when view_index is out of range for the dashboard's view count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
url_pathYesDashboard url_path (not a view path), from dashboards_list_dashboards.
view_indexYesZero-based index of the target view within the dashboard's 'views' list.
card_configYesLovelace card config, e.g. {'type': 'entities', 'entities': ['light.living_room']}.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.25.1
    • addedInput schema / properties / card_config / description
      Added value: +"Lovelace card config, e.g. {'type': 'entities', 'entities': ['light.living_room']}."
    • addedInput schema / properties / url_path / description
      Added value: +"Dashboard url_path (not a view path), from dashboards_list_dashboards."
    • addedInput schema / properties / view_index / description
      Added value: +"Zero-based index of the target view within the dashboard's 'views' list."
  2. First observedv0.3.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already specify readOnlyHint=false, destructiveHint=false, idempotentHint=false, and openWorldHint=false. The description adds valuable mechanism context: it reads via dashboards_get_dashboard_config, appends the card, writes the whole dashboard back, round-trips other views unchanged, returns a saved status, and raises ValueError on an out-of-range view_index. This is richer than the annotations alone, though it does not cover concurrency or every edge case.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action, then structured with mechanism, use cases, exclusions, return value, and errors. Every sentence serves a purpose and the block format makes it easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, annotations, full schema coverage, and existing output schema, the description supplies everything an agent needs: mechanism, when to use it, when not to, return shape, and error behavior. Nothing essential is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents url_path, view_index, and card_config. The description explains that card_config is appended to views[view_index]["cards"] and that an out-of-range index raises an error, but it adds only limited semantics beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: append a card to one view's cards list and save the dashboard. It explicitly distinguishes the operation from dashboards_add_card_to_section for sections views, so an agent can identify the tool without confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit use conditions ('Use when: adding a card to a masonry/panel view') and exclusions ('Not for: a type: sections view') with the correct alternative. This leaves no ambiguity about when to choose this tool versus its sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools