Skip to content

Commit 4d9d4c8

Browse files
kingpanther13claude
andcommitted
docs(overview): enumerate dismissed_repair_count in fields= description
`dismissed_repair_count` is set on `ha_get_overview`'s response when the caller omits `include_dismissed_repairs` (default) AND there are dismissed repairs being hidden — it tells the agent how many were filtered out so they know to flip the flag to see them. The key has been emitted since #1309, but when #1225 introduced the comma-separated ``Available keys:`` enumeration in the `fields=` parameter description the key was missed. Functionally the key already worked via `fields=["dismissed_repair_count"]` (project_fields passes it through), so this is a docstring/discoverability fix — an agent reading the `fields=` description didn't know it could request the key. Adds a static regression test (`tests/src/unit/test_fields_projection_docstring_completeness.py`) that AST-walks the response builders for each tool with a `fields=` parameter and asserts the `Available keys:` enumeration matches the keys the code emits, in both directions: - emitted but not enumerated — what slipped past on this PR's bug - enumerated but not assigned — sibling drift in PR #1381 a473e16 where `notifications`/`repairs` were documented but only assigned conditionally. Static AST catches "never assigned anywhere"; "assigned only under `if x:`" needs runtime checking (which PR #1381's `TestHaGetOverviewAlwaysEmittedKeys` provides). Covers 6 tools: ha_get_overview, ha_search_entities, ha_get_history, ha_config_list_areas, ha_list_services (AST harvest), and ha_get_state (manifest pin, since its keys come from HA's entity-record schema, not from code we own). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e6cc7a1 commit 4d9d4c8

2 files changed

Lines changed: 410 additions & 5 deletions

File tree

src/ha_mcp/tools/tools_search.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,11 +1230,12 @@ async def ha_get_overview(
12301230
"Available keys: success, system_summary, domain_stats, "
12311231
"area_analysis, ai_insights, pagination, partial, warnings, "
12321232
"device_types, service_availability, system_info, "
1233-
"notification_count, notifications, repair_count, repairs, "
1234-
"repairs_error, tool_discovery. The ``settings_url`` "
1235-
"field (stdio mode only, see tool description) is not "
1236-
"subject to this projection — it is always included "
1237-
"when the settings-UI sidecar is running."
1233+
"notification_count, notifications, repair_count, "
1234+
"dismissed_repair_count, repairs, repairs_error, "
1235+
"tool_discovery, settings_url. Note: ``settings_url`` "
1236+
"(stdio mode only, see tool description) is emitted "
1237+
"regardless of ``fields=`` projection — it is always "
1238+
"included when the settings-UI sidecar is running."
12381239
),
12391240
),
12401241
] = None,

0 commit comments

Comments
 (0)