Set tool metadata in calendar (#182710)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Paulus Schoutsen
2026-09-24 21:26:36 +02:00
committed by GitHub
co-authored by Claude
parent ad076d23a0
commit c5a82be26e
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -14,6 +14,7 @@ from homeassistant.helpers.llm import (
LLM_API_ASSIST,
LLMContext,
Tool,
ToolAnnotations,
ToolInput,
ToolResult,
)
@@ -27,11 +28,16 @@ class CalendarGetEventsTool(Tool):
"""LLM Tool allowing querying a calendar."""
name = "calendar__get_events"
title = "Get calendar events"
description = (
"Get events from a calendar. "
"When asked if something happens, search the whole week. "
"Results are RFC 5545 which means 'end' is exclusive."
)
annotations = ToolAnnotations(
read_only=True, destructive=False, idempotent=True, open_world=False
)
integration = DOMAIN
def __init__(self, calendars: list[str]) -> None:
"""Init the get events tool."""
+5
View File
@@ -62,6 +62,11 @@ async def test_calendar_get_events_tool(hass: HomeAssistant) -> None:
)
assert tool is not None
assert tool.parameters.schema["calendar"].container == ["Mock Calendar Name"]
assert tool.title == "Get calendar events"
assert tool.integration == calendar.DOMAIN
assert tool.annotations == llm.ToolAnnotations(
read_only=True, destructive=False, idempotent=True, open_world=False
)
calls = async_mock_service(
hass,