Skip to content

Commit e27063f

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 401b7b4 commit e27063f

2 files changed

Lines changed: 403 additions & 2 deletions

File tree

src/ha_mcp/tools/tools_search.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,8 +1230,9 @@ 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."
1233+
"notification_count, notifications, repair_count, "
1234+
"dismissed_repair_count, repairs, repairs_error, "
1235+
"tool_discovery."
12351236
),
12361237
),
12371238
] = None,

0 commit comments

Comments
 (0)