Skip to main content
Glama

Add section to dashboard view

dashboards_add_section_to_view

Add a new section to a Home Assistant sections dashboard view, optionally at a specific position. Use it to create a card group before adding cards.

Instructions

Insert a new section into a type: sections view.

Resolves the view via _load_view, requires it to be a sections view, defaults section_config to {"type": "grid", "cards": []} when omitted, inserts it into that view's sections list at position (or the end), and saves the whole dashboard back. When expected_config_hash is given, it is checked against the dashboard's hash right after the read and before any change.

Use when: adding a whole new section (a card group with its own grid) to a sections view, before populating it with dashboards_add_card_to_section. Pass expected_config_hash whenever position came from an earlier read that might now be stale. Returns: {status: "added", url_path, view_index, view_title, section_index, sections_in_view, config_hash} — config_hash is re-read from HA after the save, ready to chain into the next call's expected_config_hash. Errors: raises ValueError when section_config["cards"] isn't a list, or the view can't be resolved/isn't a sections view. Returns {"error": "config_changed", "expected_config_hash", "current_config_hash", "action"} without saving when expected_config_hash doesn't match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
positionNoZero-based index within the view to insert the section at. Omit to append at the end.
url_pathYesDashboard url_path, or a view path in the default dashboard (e.g. 'living-room').
view_indexNoZero-based view index; needed only when url_path names a dashboard rather than a view path.
section_configNoSection body, e.g. {'cards': [{'type': 'heading', 'heading': 'Living Room'}]}. Omit for an empty grid section.
expected_config_hashNoOptional guard: the config_hash from a recent dashboards_get_view_sections or section-tool response. If the dashboard's current hash differs, this call returns 'config_changed' and saves nothing, since position is a plain index and a change since your read may insert the new section somewhere unintended. Omit to skip the check (today's behaviour).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.25.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations provide readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=false, but the description adds significant context: it explains the read-modify-write flow, the default section_config behavior, the config hash guard and its race-condition rationale, exact error conditions (ValueError for non-list cards or unresolvable view), and the structured return value including config_hash for chaining. This goes well beyond annotation hints.

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

Conciseness4/5

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

Well-structured with clear sections ('Use when', 'Returns', 'Errors'). Front-loaded with the core action. The description is long but every sentence adds distinct, actionable information; no obvious fluff. Slightly verbose for an agent, but justified by the complexity of the operation.

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 mutation nature (destructiveHint=false but read-modify-write), the presence of an output schema, and 5 parameters, the description covers all critical aspects: default behavior, error conditions, return shape, chaining with config_hash, and the optional concurrency guard. 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.

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds nuanced context beyond the schema: it clarifies that section_config defaults to empty grid, that position is zero-based and appends if omitted, and that expected_config_hash guards against stale reads. This is more than repeating schema text.

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?

States a specific verb ('Insert a new section'), resource ('type: sections view'), and scope ('Resolves the view via _load_view, requires it to be a sections view'). Clearly distinguishes from sibling dashboards_add_card_to_section by naming the correct sequence (add section, then populate with cards).

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?

Explicit 'Use when' section names the scenario and routing: 'adding a whole new section (a card group with its own grid) to a sections view, before populating it with dashboards_add_card_to_section.' Also advises when to pass expected_config_hash ('whenever position came from an earlier read that might now be stale').

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