Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d0ee42d
feat: convert 4 doc tools to MCP resources and skill references
kingpanther13 Mar 21, 2026
5f1b2b2
fix: remove unused asyncio import, update resource tests
kingpanther13 Mar 21, 2026
477bc6a
fix: add input sanitization and 404 handling for doc resources
kingpanther13 Mar 21, 2026
baf222a
refactor: remove ha://docs/ resource templates, use skills framework
kingpanther13 Mar 21, 2026
8e0adfd
fix: tighten test assertion and clean up stale pyproject globs
kingpanther13 Mar 21, 2026
6578f45
feat: Search-based tool discovery with categorized call proxies (#727)
kingpanther13 Mar 21, 2026
eb81e43
chore: migrate from pre-commit to lefthook for parallel hook executio…
sergeykad Mar 22, 2026
0dfd427
merge: resolve conflict with upstream/master
kingpanther13 Mar 22, 2026
741ee5c
fix: add skill/resource tools to s13 UAT story tools_should_use
kingpanther13 Mar 22, 2026
9eef2b5
fix: restore skills-vendor submodule to correct commit
kingpanther13 Mar 22, 2026
6288ba6
ci(deps): bump renovatebot/github-action in the github-actions group …
dependabot[bot] Mar 23, 2026
625390a
deps(deps-dev): bump the dev-dependencies group with 2 updates (#808)
dependabot[bot] Mar 23, 2026
e307835
deps(deps-dev): bump openai from 2.28.0 to 2.29.0 (#809)
dependabot[bot] Mar 23, 2026
adafce8
deps(deps-dev): bump testcontainers from 4.14.1 to 4.14.2 (#810)
dependabot[bot] Mar 23, 2026
5cbcb37
feat: add Python 3.14 support (#700)
kingpanther13 Mar 23, 2026
7fb4170
fix: surface connection errors in ha_get_overview instead of returnin…
sergeykad Mar 24, 2026
eb7f552
chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.11.0 (#816)
github-actions[bot] Mar 24, 2026
f0c0c83
chore(ci): bump uv in PR workflow from 0.9.30 to 0.11.0 and add Renov…
kingpanther13 Mar 24, 2026
4fd0587
Merge branch 'master' into feat/docs-tools-to-resources
kingpanther13 Mar 25, 2026
9d9ebb9
fix: remove stale jq code from merge resolution
kingpanther13 Mar 25, 2026
c97d839
Clarify Claude.ai connection error and stateless session logs (#805)
kingpanther13 Mar 25, 2026
6595540
chore(deps): bump smol-toml from 1.6.0 to 1.6.1 in /site (#818)
dependabot[bot] Mar 25, 2026
943c6f4
deps(deps-dev): bump requests from 2.32.5 to 2.33.0 (#819)
dependabot[bot] Mar 25, 2026
a26280f
chore(deps): bump yaml from 2.8.2 to 2.8.3 in /site (#820)
dependabot[bot] Mar 25, 2026
004fe26
chore(deps): bump picomatch in /site (#821)
dependabot[bot] Mar 26, 2026
f62e800
chore(deps): bump astro from 5.16.11 to 5.18.1 in /site (#826)
dependabot[bot] Mar 26, 2026
caf8f49
fix: update test to match enable_skills_as_tools=True default
kingpanther13 Mar 26, 2026
2ed3887
fix: add exact_match to all search tools, badge search, and dashboard…
kingpanther13 Mar 27, 2026
e354782
Potential fix for code scanning alert no. 31: Workflow does not conta…
sergeykad Mar 27, 2026
dc9f6d8
deps(deps): bump cryptography from 46.0.5 to 46.0.6 (#830)
dependabot[bot] Mar 27, 2026
761e5c3
docs: document OAuth v7.0.0 breaking change (HOMEASSISTANT_URL requir…
sergeykad Mar 27, 2026
7a573f8
merge: resolve conflict with upstream/master
kingpanther13 Mar 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def register_<domain>_tools(mcp, client, **kwargs):
@log_tool_usage
async def ha_<verb>_<noun>(param: str) -> dict[str, Any]:
"""One-line summary starting with action verb."""
# For complex schemas, add: "Use ha_get_domain_docs('<domain>') for details."
# For complex schemas, add: "Use read_resource('ha://docs/domains/<domain>') for details."
```

### Safety Annotations
Expand Down Expand Up @@ -693,14 +693,14 @@ Context engineering treats LLM context as a finite resource with diminishing ret

| Pattern | Example |
|---------|---------|
| **Docs on demand** | Tool descriptions reference `ha_get_domain_docs()` instead of embedding full documentation |
| **Docs on demand** | Tool descriptions reference `ha://docs/domains/{domain}` resources instead of embedding full documentation |
| **Hints in UX flow** | First tool in a workflow hints at related tools (e.g., `ha_search_entities` suggests `ha_get_state`) |
| **Error-driven discovery** | When a tool fails, the error response hints at `ha_get_domain_docs()` for syntax help |
| **Error-driven discovery** | When a tool fails, the error response hints at `ha://docs/` resources or the skill guidance tool for help |
| **Layered parameters** | Required params first, optional params with sensible defaults |
| **Focused returns** | Return essential data; let user request details via follow-up tools |

**Practical examples in this codebase:**
- `ha_config_set_helper` has minimal docstring, points to `ha_get_domain_docs()` for each helper type
- `ha_config_set_helper` has minimal docstring, points to `ha://docs/domains/` resources for each helper type
- Search tools return entity IDs and names; full state requires `ha_get_state`
- Error responses include `suggestions` array guiding next steps

Expand All @@ -718,7 +718,7 @@ Task tool with model=haiku or model=sonnet:

This reveals:
- What the model knows from training (no need to document)
- What gaps exist (target these with `ha_get_domain_docs()` hints)
- What gaps exist (target these with `ha://docs/domains/` resource hints)
- Confidence levels across model tiers (haiku vs sonnet vs opus)

**Important: Fact-check model claims.** Models can hallucinate plausible-sounding syntax. Always verify against HA Core source:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Spend less time configuring, more time enjoying your smart home.
| **Automations** | `ha_config_get_automation`, `ha_config_set_automation`, `ha_config_remove_automation` |
| **Scripts** | `ha_config_get_script`, `ha_config_set_script`, `ha_config_remove_script` |
| **Helper Entities** | `ha_config_list_helpers`, `ha_config_set_helper`, `ha_config_remove_helper` |
| **Dashboards** | `ha_config_get_dashboard`, `ha_config_set_dashboard`, `ha_config_delete_dashboard`, `ha_get_dashboard_guide`, `ha_get_card_documentation` |
| **Dashboards** | `ha_config_get_dashboard`, `ha_config_set_dashboard`, `ha_config_delete_dashboard` + dashboard skill references |
| **Areas & Floors** | `ha_config_list_areas`, `ha_config_set_area`, `ha_config_remove_area`, `ha_config_list_floors`, `ha_config_set_floor`, `ha_config_remove_floor` |
| **Labels** | `ha_config_get_label`, `ha_config_set_label`, `ha_config_remove_label`, `ha_manage_entity_labels` |
| **Zones** | `ha_get_zone`, `ha_set_zone`, `ha_remove_zone` |
Expand All @@ -154,7 +154,7 @@ Spend less time configuring, more time enjoying your smart home.
| **Automation Traces** | `ha_get_automation_traces` |
| **System & Updates** | `ha_check_config`, `ha_restart`, `ha_reload_core`, `ha_get_system_info`, `ha_get_system_health`, `ha_get_updates` |
| **Backup & Restore** | `ha_backup_create`, `ha_backup_restore` |
| **Utility** | `ha_get_logbook`, `ha_eval_template`, `ha_get_domain_docs`, `ha_get_integration` |
| **Utility** | `ha_get_logbook`, `ha_eval_template`, `ha_get_integration` + `ha://docs/` resources |

</details>

Expand All @@ -173,7 +173,7 @@ Skills from `homeassistant-ai/skills` are bundled and served as [MCP resources](
| Setting | Default | Description |
|---------|---------|-------------|
| `ENABLE_SKILLS` | `true` | Serve skills as MCP resources. Resources are not auto-injected into context — clients must explicitly request them. |
| `ENABLE_SKILLS_AS_TOOLS` | `false` | Also expose skills via `list_resources`/`read_resource` tools for clients that don't support MCP resources natively. |
| `ENABLE_SKILLS_AS_TOOLS` | `true` | Expose skills and doc resources via `list_resources`/`read_resource` tools. Resource-capable clients can set to `false` to reduce tool count. |

Skills can still be installed manually for clients that prefer local skill files — see the [skills repo](https://github.com/homeassistant-ai/skills) for instructions.

Expand Down
2 changes: 1 addition & 1 deletion homeassistant-addon/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ The add-on provides 80+ MCP tools for controlling Home Assistant:
### Utility
- `ha_get_logbook` - Historical events
- `ha_eval_template` - Evaluate Jinja2 templates
- `ha_get_domain_docs` - Domain documentation
- Domain documentation available via `ha://docs/domains/{domain}` MCP resources
- `ha_get_integration` - List or get integration info

See the [main repository](https://github.com/homeassistant-ai/ha-mcp) for detailed tool documentation and examples.
Expand Down
8 changes: 5 additions & 3 deletions src/ha_mcp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ class Settings(BaseSettings):
# Resources are not auto-injected — clients must explicitly request them.
enable_skills: bool = Field(True, alias="ENABLE_SKILLS")

# Expose skills as tools (list_resources/read_resource) for clients
# that don't support MCP resources natively.
enable_skills_as_tools: bool = Field(False, alias="ENABLE_SKILLS_AS_TOOLS")
# Expose skills and doc resources as tools (list_resources/read_resource)
# for clients that don't support MCP resources natively.
# Defaults to True so all clients can access documentation and skills.
# Resource-capable clients can set to False to reduce tool count.
enable_skills_as_tools: bool = Field(True, alias="ENABLE_SKILLS_AS_TOOLS")

@property
def env_file_name(self) -> str:
Expand Down
6 changes: 3 additions & 3 deletions src/ha_mcp/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ErrorCode(StrEnum):
"Entity domain must match the original domain",
],
ErrorCode.SERVICE_NOT_FOUND: [
"Use ha_get_domain_docs() to see available services",
"Use read_resource('ha://docs/domains/{domain}') or ha_get_skill_home_assistant_best_practices for documentation",
"Check the service name spelling",
"Verify the domain supports this service",
],
Expand All @@ -148,7 +148,7 @@ class ErrorCode(StrEnum):
ErrorCode.SERVICE_INVALID_ACTION: [
"Check available actions for this domain",
"Common actions: turn_on, turn_off, toggle",
"Use ha_get_domain_docs() for service documentation",
"Use read_resource('ha://docs/domains/{domain}') or ha_get_skill_home_assistant_best_practices for documentation",
],
ErrorCode.SERVICE_CALL_FAILED: [
"Check the service parameters are correct",
Expand All @@ -161,7 +161,7 @@ class ErrorCode(StrEnum):
],
ErrorCode.CONFIG_INVALID: [
"Review the configuration format",
"Use ha_get_domain_docs() for configuration help",
"Use read_resource('ha://docs/domains/{domain}') or ha_get_skill_home_assistant_best_practices for configuration help",
],
ErrorCode.CONFIG_MISSING_REQUIRED_FIELDS: [
"Check documentation for required fields",
Expand Down
48 changes: 0 additions & 48 deletions src/ha_mcp/resources/card_types.json

This file was deleted.

Loading