Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / docs / openassistant-intents-audit.md

openassistant-intents-audit.md37.7 KiBRenderedCodeRaw

OpenAssistant Intents Audit — Modern-Apps

Date: 2026-12-01 (America/Denver) · Branch: agent-oa-intents · Worktree: /home/vayun/code/wt-oa-intents · Scope read: openassistant/ + library/ (intents/, util/AssistantIntent.kt) + every app's AGENTS.md overview + each app's intents/ package where one exists. No app code was changed. This is an audit + design document only.

0. How to read this, and the context rule

Verified mechanism (not assumed). Cross-app assistant calls go through AssistantIntent<In,Out> (library/util/AssistantIntent.kt): a NoDisplay ComponentActivity in the target app decodes JSON DATA, runs suspend performCalculation(input), and replies with JSON RESPONSE_DATA over a ResultReceiver. IntentLauncher (same file) serialises launches with a mutex and a 30 s timeout. Shared wire DTOs live in library/src/main/java/com/vayunmathur/library/intents/<app>/; each app exposes validated contracts in <app>/.../intents/. OpenAssistant dispatches via domain/AssistantToolSpecs.kt (the catalogue: name, risk, description, params) and platform/AssistantTools.kt (the handler map) — an init check fails if they disagree. Host-side back ends are platform/AssistantCoreToolIntents.kt (notes/todo/contacts/calendar/ family/music/email/clock/weather/maps/taxi) and platform/AssistantToolIntents.kt (communicate/food/shop + summarizers). Tool names are snakecase. Risk classes in the catalogue: - = READ, C = WRITECONFIRM (gated through a pending-call store, executed once via invokeConfirmed), L = WRITELIGHT (executed immediately, result rendered back), H = HANDOFFPREP (prepares a summary; the user acts in the target app; never money-moving).

Why size caps are the whole game. PromptBudgetTest pins the system header (default prompt + A2UI section + all tool declarations) at ≤ 24,500 chars (≈ 6k tokens at ~4 chars/token). The on-device model (Gemma 4 E2B) then fits history (domain/HistoryFit) and up to 6 tool rounds (domain/ToolLoop). Every tool result is re-injected as text, so one unbounded result evicts history and can dominate all later rounds. Design rule applied to every proposal below (owner's rule, restated as a contract):

  1. Inputs are filtered or query-based: a text query, a date/range

window, a category/enum filter, an id from a prior search — never "give me everything".

  1. Result counts are capped provider-side (validated/clamped in the

app's intents/ backend, not just in the spec text), and the host summarizer truncates each text field to a stated char cap.

  1. A full-dataset return is allowed only when the dataset is provably

small; the bound is named (e.g. "≤ 20 family members in practice, hard-cap 50").

  1. Estimates below use chars ÷ 4 ≈ tokens. "Typical" assumes realistic

personal data; "max" is the contractual worst case after caps.

Good existing patterns to copy. AssistantWebTools: web_search clamps count 1–10 and reshapes to {title,url,snippet}; web_read returns 6,000-char pages paged by offset, with a 2M-char fetch cap and a 4-page × 24k cache. Food/shop/communicate backends clamp limits provider-side (MAX_RESTAURANT_LIMIT=50, MAX_SEARCH_LIMIT=50, MAX_FIND_LIMIT=50/MAX_MESSAGES_LIMIT=100) and host summarizers cap per-item text (conversation snippet 80 chars, message body 200 chars, menu shown 24 items, orders shown 10). Calendar's provider caps at 500 events explicitly to stay under the binder transaction limit.


1. What exists today

1.1 Tool catalogue (54 tools)

Counted from TOOL_DATA in AssistantToolSpecs.kt and the handler map in AssistantTools.kt (they agree — the init check enforces it).

App / surfaceToolR/WInput → Output (wire DTO)Host summarizer?
notesget_notesRUnit → List<NoteData{title,content}>No — raw .toString()
notescreate_noteCNoteData → Unitn/a (success string)
todoget_todosRGetTodosQuery{scope} → List<TodoData> (provider cap 200)No — raw .toString()
todocreate_todoCInsertTodoData → String(id)n/a
todocomplete_todoC`CompleteTodoData{idtitle} → Boolean`
contactsget_contactsRUnit → List<ContactData{name,phone}>No — raw .toString()
contactssearch_contactsRquery → filters the full list host-side, cap 10Yes (filter)
contactscreate_contactCContactData → Unitn/a
calendarget_calendar_eventsRUnit → List<EventData> (provider cap 500)No — raw .toString()
calendarcreate_calendar_eventCEventData → Unit (validated)n/a
findfamilyget_family_locationsRUnit → List<FamilyMemberData{name,locationName,lat,lon}>No — raw .toString()
findfamilycreate_location_share_linkC{name,duration} → String(link)n/a
musicsearch_musicRString(query) → List<MusicSearchResult{id,name,type}>No cap anywhere
musicplay_musicCPlayMusicData{id,type} → Unitn/a
emailsearch_emailsREmailSearchQuery → List<EmailData> (DAO LIMIT 30)No — raw .toString(), body ≤2,000 ch each
emailget_recent_emailsRUnit → List<EmailData> (DAO LIMIT 30)No — same
clockset_alarmCSetAlarmData{hour,minute,label} → Unitn/a
clockset_timerCSetTimerData{seconds,label} → Unitn/a
weatherget_weatherR{lat,lon} → WeatherData (single record).toString() of one record — fine
weatherget_weather_by_nameR{name} → WeatherData (geocode limit 1)fine
mapsget_directionsRDirectionsRequest{coords,mode} → DirectionsResult{polyline,segments,totals}Yes — totals + segment count only
taxiget_ride_estimateRRideEstimateRequest → RideEstimateResultYes — one line
fooddeliveryfood_order_lookupROrderLookupRequest → OrderLookupResultYes — one line
fooddeliveryfind_restaurantsRFindRestaurants{query?,lat,lng,limit=5} (backend cap 50)Yes — address ≤60 ch
fooddeliveryget_restaurant_menuRGetMenu{merchantId} → MenuData (full menu over the wire)Yes — 24 items shown
fooddeliveryfood_get_cartRGetCart → CartDataYes
fooddeliveryfood_set_cartLSetCart{merchantId,items} (re-validated)Yes — cart rendered back
fooddeliveryfood_prepare_orderRPrepareOrder → OrderSummaryData (prices only, creates nothing)Yes
fooddeliveryplace_food_orderHmerchantId → priced summary + fooddelivery://checkoutYes — user pays in-app
fooddeliveryget_food_ordersRGetOrders → List<OrderData>Yes — cap 10
shopsearch_productsRSearchProductsQuery{query,limit=5} (backend cap 50)Yes — one line/variant
shopget_product_detailRGetProductQuery → ProductDetailData (description field exists)Yes — variants only, description dropped
shopshop_get_cartRUnit → CartData (grouped by store)Yes
shopshop_add_to_cartLAddToCartRequest (exact variant re-verified)Yes — cart rendered back
shopshop_remove_from_cartLRemoveFromCartRequest{variantId} → CartDataYes
shopstart_shop_checkoutHshop_domain → per-store summary + shop://cartYes — user checks out in-app
shopget_shop_ordersRUnit → List<OrderData>Yes — cap 10
communicatefind_conversationsRFindConversationsQuery{query,limit=5} (backend cap 50)Yes — snippet ≤80 ch
communicateget_conversation_messagesRGetMessagesQuery{threadKey,limit=10} (backend cap 100)Yes — body ≤200 ch/msg
communicatedraft_messageR*recipient/line/body → A2UI composer cardSends nothing (*renders UI)
communicatesend_message_v2CSendMessageRequest → SendMessageResult (GV typed-refused)Yes
openassistant (internal)get_memories / add_to_memory / remove_memoryR / R(!) / CRoom MemoryDao directNo cap on get_memories
openassistant (internal)get_local_current_date_time, set_conversation_titleRdevice directtiny
openassistant (device)get_app_listRlauncher activities → labelsNo cap — raw list .toString()
openassistant (device)open_appR(!)package_id → launch intentside effect, classified READ
openassistant (device, legacy)send_messageR(!)recipient+message → opens SMS composer (ACTION_SENDTO)Not WRITE_CONFIRM — see §1.3
openassistant (device, legacy)make_phone_callR(!)recipient → opens dialer (ACTION_DIAL)Not WRITE_CONFIRM — see §1.3
openassistant (web)web_searchRquery, count 1–10, kind text/newsYes — {title,url,snippet}
openassistant (web)web_read / web_read_resultRurl / index+offsetYes — 6,000-ch pages
openassistant (UI)render_uiRA2UI JSON, ≤12,000 ch enforcedn/a

DTO packages present in library/intents/: calendar, clock, communicate, contacts, email, euicc (see §1.4), findfamily, fooddelivery, maps, music, notes, shop, taxi, todo, weather. Apps with an intents/ package: calendar, clock, communicate, contacts, email, findfamily, fooddelivery, logviewer (see §1.4), maps, music, notes, shop, taxi, todo, weather.

1.2 Data-volume estimates for existing reads

ToolTypicalWorst case todayVerdict
get_notes30 notes × ~600 ch ≈ 18k ch (~4.5k tok)500 notes × 10k ch content — unbounded🔴 flood risk
get_contacts300 × ~35 ch ≈ 10k ch (~2.6k tok)5,000 contacts ≈ 175k ch🔴 flood + binder risk
get_calendar_events500 × ~60 ch ≈ 30k ch (~7.5k tok)capped at 500, still ~30k ch🟠 too big for a "what's on" answer
get_todos200 × ~80 ch ≈ 16k ch (scope=today usually ≪)200 cap, ~16k ch🟠 shrink cap for all
search_emails / get_recent_emails30 × (subject+from+≤2,000 ch body) ≈ up to 66k ch (~16k tok)same — DAO LIMIT 30 is the only cap🔴 biggest single flood
search_musicquery-dependent; 4 entity types concatenated, no capwhole library matches a common letter🔴 uncapped
get_family_locations5–15 members × ~60 ch ≈ 1k chunbounded in code; dataset provably small (family)🟢 add hard cap 50 anyway
get_app_list100–300 labels ≈ 3–8k ch~300+ labels🟠 cap/sort or query-based
get_memoriesuser-grown list, one line eachunbounded over years🟠 cap (e.g. last 100)
get_conversation_messages10 × ≤200 ch ≈ 2k chlimit=100 → ~21k ch🟢 typical fine; clamp spec max to 50
get_restaurant_menusummarizer shows 24 items (~3k ch to model)full MenuData (100+ items + modifiers) crosses the binder🟢 model-side fine; 🟠 wire-side: page provider-side
get_weather, get_directions, get_ride_estimate, food_order_lookupsingle record / one line—🟢 exemplars
find_restaurants, search_products, orders, carts≤5–10 short linesbackend caps 50 if model asks🟢 good
web_search / web_read≤10 hits / 6k ch page—🟢 exemplar

1.3 Risk-classification findings (existing)

  • send_message and make_phone_call (legacy device tools) are

classified READ (-) but open a composer/dialer. They do not send or call directly (user taps), so impact is low — but they should be re-classified or folded into draft_message / a dialer handoff, and the catalogue should not carry two send paths (send_message vs send_message_v2).

  • add_to_memory is READ-class yet writes. It is the model's own memory

and remove_memory is WRITE_CONFIRM, so this looks deliberate; note it, don't churn it.

  • open_app is READ-class with a visible side effect (foregrounds an

app). Acceptable, worth a spec-wording tweak only.

  • Writes that move money do not exist — by design. Food/shop use

HANDOFFPREP + in-app checkout; travel (below) must follow the same rule. Deletes: none exposed except `removememory (confirm-gated) and shopremovefrom_cart` (light, local cart only). This is the right posture; proposals keep it.

1.4 intents/ ≠ assistant coverage

  • euicc: library/intents/euicc/EsimLink.kt is a shared eSIM deep-link

constant, not an AssistantIntent. No OA tool. Correct — see §4.

  • logviewer: intents/ holds LogcatActivity/ErrorReportActivity

entry points, not assistant contracts. No OA tool.

  • maps: intents/ also hosts cross-app clients (OrderLookupClient,

RideEstimateClient, FamilyLocationClient) — maps consuming food/taxi/findfamily, not OA tools.

  • code: "handles VIEW/EDIT intents" = Android intent filters, not

assistant intents.


2. Design rules for every proposal

Each proposal names: tool (snake_case) · app · read/action (risk class) · input DTO · output DTO + max response size · contract location (library/intents/<app>/… DTOs + <app>/…/intents/…Intent.kt provider + two OA touchpoints: AssistantToolSpecs.kt row + AssistantTools.kt handler with a host summarizer in AssistantToolIntents.kt).

Universal caps unless stated otherwise: list limit default 5, hard max 20 (search) / 10 (detail lists); title ≤ 120 ch; snippet/body excerpt ≤ 300 ch; one-line summaries ≤ 200 ch; ids are short stable strings from the provider. No proposal returns a full feed, full library, full history, full document, or full message/email body. Bodies are available only through a follow-up get-by-id with a stated char cap and offset paging where the text can be long (the web_read pattern).

Priorities: P0 = clear user value + small data + provider data already local/queryable. P1 = valuable, needs a new provider query or moderate DTO work. P2 = niche, sensitive, or larger design surface.


3. Proposed tools

3.0 P0 — News (owner-named; currently zero intents)

News has no intents/ package and no DTOs. Verified shape: feed is Room-cached CachedArticle{url,sourceId,title,publishedAtMillis,imageUrl, keywords,bookmarked,storyId,storyOneLiner,storyTitle} (cache pruned to 500), grouped into domain/Story (server storyId only); categories are NewsCategory{WORLD,US,TECHNOLOGY,SCIENCE,LOCAL} derived from the source catalog; on-device search (NewsRepository.search + domain/NewsSearch, relevance-ranked) already exists over titles/keywords/source/bodies of opened articles; article bodies are extracted on device (NewsRepository.articleBody(url) → ExtractedArticle{blocks}) and can be long. Never return the 500-article cache or an extracted body whole.

ToolR/WInput DTOOutput DTO + capMax size
news_search_headlinesRNewsSearchQuery{query:String (req, ≤200 ch), category:String? (enum name), limit:Int=5 (clamp 1–10)}List<NewsHeadlineData{storyId,url,title≤160 ch,sourceName,sourceCount,publishedAtMillis,oneLiner≤200 ch?}>10 × ~350 ch ≈ 3.5k ch (~0.9k tok)
news_top_storiesRNewsTopQuery{category:String?=null, local:Boolean=false, limit:Int=5 (clamp 1–10)}same NewsHeadlineData list, feed ranking (sourceCount desc, newest)≈ 3.5k ch
news_get_storyRNewsStoryQuery{storyId:String (from search/top)}NewsStoryData{title,oneLiner≤300 ch,members≤8×{title≤160 ch,sourceName,publishedAtMillis,url}}≈ 2k ch
news_read_articleRNewsArticleQuery{url:String (req, from a prior result), offset:Int=0}NewsArticleExcerptData{title,byline?,excerpt≤3,000 ch,nextOffset:Int?} — extracted paragraphs joined + truncated provider-side; paging by offset like web_read3k ch (~0.75k tok)/page
news_get_bookmarksRNewsBookmarksQuery{limit:Int=10 (clamp 1–20)}List<NewsHeadlineData> (bookmarked only)20 × ~350 ≈ 7k ch worst; typical ≪
news_set_bookmarkC (WRITE_CONFIRM)NewsBookmarkRequest{url,bookmarked:Boolean}String successtiny

Contracts: library/intents/news/NewsData.kt (DTOs above) + news/.../intents/{SearchHeadlinesIntent,TopStoriesIntent,GetStoryIntent, ReadArticleIntent,GetBookmarksIntent,SetBookmarkIntent}.kt over NewsRepository (search/top/bookmarks are Room reads; read_article reuses articleBody() then truncates — the full ExtractedArticle must not cross as-is). Privacy: all local; the only network the provider may already do is its normal refresh — the intents should read the cache and not trigger a refresh (stale headlines beat a 30 s tool timeout).

Also note the overlap: web_search kind=news already searches the web for news. These tools answer "what's in my news app / my feed / my bookmarks" and read articles the app has already extracted — different data, no duplication problem.

3.1 P0 — fixes to existing floods (no new app, shrink the wire)

These are not new tools; they are cap retrofits the audit ranks P0 because the tools already exist and already flood:

FixChange
get_notes → add search_notesNew SearchNotesQuery{query,limit=10} returning title + ≤200 ch excerpt; deprecate raw get_notes or cap it provider-side (limit param, content ≤300 ch/note). Contract: library/intents/notes/ + notes/intents/SearchIntent.kt.
get_contactsCap provider-side (e.g. 200, sorted) as a binder guard; steer the model to search_contacts (already capped 10). Long-term: make search_contacts query provider-side instead of fetching all contacts to the host.
search_emails/get_recent_emailsSplit DTO: list calls return EmailData without body (subject/from/date/isRead + ≤200 ch snippet); add get_email_excerpt (get-by-id, body ≤3,000 ch + offset). Needs an id field on EmailData (additive, defaulted — DTO-compat rule).
search_musicProvider-side cap 20 total (songs/albums/artists/playlists share the budget), spec gains optional limit.
get_calendar_eventsAdd range input (CalendarQuery{fromMillis,toMillis,limit=50}); default window = next 7 days. Keep 500 as a binder guard, not the model-visible size.
get_todos(scope=all)Lower model-visible cap to 50 for all (provider already caps 200 for binder safety; summarizer-side take(50)).
get_app_listCap 100 sorted labels, or add query filter.
get_memoriesReturn last 100 (id desc) with a "(N more)" line.
get_conversation_messagesClamp spec max 100 → 50 (backend already clamps; align the catalogue).

3.2 P0/P1 — new app coverage

#ToolAppR/WInput → Output (caps)MaxPri
1maps_search_placesmapsRMapsPlaceSearchQuery{query,lat?,lng?,limit=5 (≤10)} → List<PlaceData{id,name≤120,address≤120,lat,lng,category?}>. Today OA can only route between raw coordinates — it cannot answer "coffee near X" or resolve a place name to coordinates for get_directions/get_ride_estimate. This is the missing front door for three existing tools. Contracts: library/intents/maps/PlaceData.kt + maps/intents/SearchPlacesIntent.kt (offline POI index; no Google calls).~2.5k chP0
2health_get_metric_summaryhealthRHealthMetricQuery{metric:enum(steps,sleep,heart_rate,weight,hydration,…), range:enum(today,7d,30d)} → HealthMetricSummaryData{metric,range,latestValue?,average?,min?,max?,total?,unit,recordCount} — aggregates only (HealthRepository.sumInRange/getDailySums/getLastRecord already exist). Never raw record lists. Contracts: library/intents/health/ + health/intents/GetMetricSummaryIntent.kt. Sensitive: health data — read-only, no export of FHIR records, see §5.~300 chP0
3health_get_medicationshealthRHealthMedsQuery{date:String?=today} → List<MedicationDoseData{name≤80,dose≤40,scheduledTimeMillis,taken:Boolean?}> cap 20. Answers "what do I take tonight?" — MedicationSchedule + DoseScheduler already model this. No dose changes proposed.~2k chP0
4flashcards_get_due_summaryflashcardsRFlashcardsDueQuery{deckId:Long?=null} → DueSummaryData{dueCount,newCount,deckName?,nextDueMillis?} or per-deck list cap 10 × {deckId,deckName≤80,dueCount}. Counts only — card fronts/backs stay out (a deck can hold thousands). Contracts: library/intents/flashcards/ + flashcards/intents/GetDueIntent.kt (FSRS due query provider-side).~1k chP0
5translate_texttranslateR (compute)TranslateQuery{text≤1,000 ch (req), targetLang (req, BCP-47/catalog code), sourceLang?=auto} → TranslateResultData{translatedText≤2,000 ch,detectedLang?}. Pure on-device NLLB via domain/TranslationEngine; degrade with typed error when models aren't downloaded. Contracts: library/intents/translate/ + translate/intents/TranslateIntent.kt.~2k chP0
6calculator_evaluatecalculatorR (compute)EvaluateQuery{expression≤200 ch} → EvaluateResultData{result:String≤100,error?} over the app's pure Expression helpers.~200 chP0
7calculator_convert_unitcalculatorR (compute)ConvertQuery{value:Double,fromUnit,toUnit} (ids from domain/UnitRegistry; currency pair allowed — rates are the app's one network call) → ConvertResultData{result,unit,rate?,asOfMillis?}.~300 chP0
8travel_get_tripstravelRTripsQuery{when:enum(upcoming,past,all)=upcoming, limit=5 (≤10)} → List<TripSummaryData{id,title≤120,startMillis,endMillis,status,origin?,destination?}> from on-device Room (getAllBookedTrips, filtered/sorted provider-side). No booking, no payment, no passenger PII (no Customer/FrequentFlyer DTOs). Contracts: library/intents/travel/ + travel/intents/GetTripsIntent.kt.~2k chP0
9screentime_get_usagescreentimeRUsageQuery{period:enum(today,yesterday,7d)=today, limit=8 (≤15)} → UsageSummaryData{totalMillis,apps≤15×{label≤60,packageName,millis,limitMillis?,paused}}. Aggregates from platform/UsageHistory; typed empty result when usage access isn't granted. Contracts: library/intents/screentime/ + screentime/intents/GetUsageIntent.kt.~2k chP1
10photos_search_photosphotosRPhotoSearchQuery{query (content/OCR/person text), limit=10 (≤20)} → List<PhotoHitData{id,takenMillis,albumName?≤60,matchReason:enum(content,ocr,person,textMatch≤120)} — metadata only: no image bytes, no paths the model could exfiltrate, no secure-folder results ever. Provider reuses the existing combined search. Contracts: library/intents/photos/ + photos/intents/SearchPhotosIntent.kt. Follow-up open-in-app stays a deep link the user taps.~2.5k chP1
11astronomy_get_tonightastronomyRTonightQuery{lat,lng,dateMillis?=today,limit=8 (≤12)} → List<SkyObjectData{id,name≤80,type,riseMillis?,setMillis?,peakAltitudeDeg?,magnitude?}> from domain/engine rise/set calculators over bundled catalogs. Fully offline; dataset is a bounded catalog, results are computed, not dumped. Contracts: library/intents/astronomy/ + astronomy/intents/TonightIntent.kt.~2k chP1
12web_get_bookmarkswebRBookmarkSearchQuery{query?=blank→recent, limit=10 (≤20)} → List<BookmarkData{title≤120,url≤300,folder?≤60}>.~4k ch worstP1
13web_search_historywebRHistorySearchQuery{query (req), limit=10 (≤20)} → List<HistoryHitData{title≤120,url≤300,visitedMillis}>. Private tabs excluded provider-side (verify no private rows are stored; if they are, filter by flag). Contracts (12–13): library/intents/web/ + web/intents/…Intent.kt.~4k ch worstP1
14youpipe_get_subscriptions_latestyoupipeRSubsLatestQuery{category?=null, limit=8 (≤15)} → List<VideoHitData{videoId,title≤140,channelName≤80,publishedMillis,durationSec?}> from the local subscription feed. Plus P2 youpipe_search_history{query,limit} over watch history. No playback/download actions (playback is a visible UI act; downloads are bulk data movement). Contracts: library/intents/youpipe/ + youpipe/intents/….~3k chP1
15files_search_filesfilesRFileSearchQuery{query (name substring, req), limit=15 (≤25)} → List<FileHitData{name≤120,path≤200,sizeBytes?,modifiedMillis,isDirectory}> — name search only (MediaStore/SAF index), no content reads, no move/copy/delete. Contracts: library/intents/files/ + files/intents/SearchFilesIntent.kt.~5k ch worstP1
16appstore_search_appsappstoreRAppStoreSearchQuery{query, limit=8 (≤15)} → List<AppHitData{packageName,name≤80,source,securityTier≤80,versionName?≤40,summary≤200}> over searchLocal (already limit-shaped). No install/update action — installs are signature-verified, user-reviewed acts (§5). Contracts: library/intents/appstore/ + appstore/intents/SearchAppsIntent.kt.~3k chP1
17appstore_get_updatesappstoreRUnit → List<AppUpdateData{packageName,name≤80,installedVersion≤40,availableVersion≤40,source}> cap 20, via updatesFor(installed). Provably small (installed-app count, hard cap).~3k chP1
18education_get_progresseducationRProgressQuery{} → ProgressSummaryData{learnerFirstName?≤40,band,streakDays,skillsStarted,skillsMastered, dueDeadlines≤5×{title≤80,dueMillis}} — aggregates over skillProgressFlow/deadlinesFlow. Kids' data: first name only, read-only, no per-answer history. Contracts: library/intents/education/ + education/intents/GetProgressIntent.kt.~1k chP1
19get_weather_forecastweatherR (extension)WeatherForecastQuery{location (name) or lat/lng, days=3 (clamp 1–7)} → List<ForecastDayData{dateMillis,highC,lowC,condition≤60,precipChancePercent}>. Existing tools return current only; the app already fetches daily arrays to build WeatherData. Contracts: extend library/intents/weather/ + new weather/intents/GetForecastIntent.kt.7 × ~120 ≈ 0.9k chP1
20maps_get_saved_placesmapsRSavedPlacesQuery{query?=null, limit=10 (≤20)} → List<PlaceData> (same DTO as #1) from SavedPlaceStore.~2.5k chP1
21music_get_now_playing + music_get_playlistsmusicRUnit → NowPlayingData{title≤120,artist≤80,album≤80?,isPlaying,positionSec?,durationSec?}; Unit → List<PlaylistData{id,name≤80,trackCount}> cap 20. Small, bounded. Contracts: extend library/intents/music/ + music/intents/….~1.5k chP1
22flashcards_search_cardsflashcardsRCardSearchQuery{query, deckId?, limit=8 (≤10)} → List<CardHitData{cardId,deckName≤80,frontExcerpt≤200,backExcerpt≤200,dueMillis?}>. Excerpts, never whole decks.~3.5k chP1
23office_list_recent_documentsofficeRRecentDocsQuery{query?=null, limit=10 (≤20)} → List<DocumentData{name≤120,kind:enum(text,sheet,slides,other),modifiedMillis,sizeBytes?}> — recents metadata only. No document content extraction (documents are unbounded; a future get-by-id excerpt tool needs its own design + E2EE-collab exclusion). Contracts: library/intents/office/ + office/intents/ListRecentIntent.kt.~3k chP2
24things_get_hydrationthingsRHydrationQuery{date?=today} → HydrationData{totalMl,goalMl,sipCount,lastSipMillis?} — only when a bottle is paired; typed unavailable otherwise. Tiny and genuinely assistant-shaped ("how much water today?"). Contracts: library/intents/things/ + things/intents/GetHydrationIntent.kt.~200 chP2
25games_get_achievements_summarygames/hubRUnit → AchievementSummaryData{level,xp,streakDays,recent≤5×{game≤60,achievement≤100,earnedMillis}} via :sdk:games reporting data. Fun, tiny, zero risk. Contracts: library/intents/games/ + hub intents/.~1k chP2
26email_draft_emailemailC-prep (HANDOFF_PREP-like)DraftEmailRequest{to≤200,subject≤200,body≤4,000} → opens composer prefilled in Email; sending stays a user tap in Email. Never a direct send tool. Contracts: library/intents/email/ + email/intents/DraftIntent.kt (activity handoff, not a silent write).tinyP2
27calendar_get_events_in_rangecalendarR(See §3.1 — this is the get_calendar_events retrofit, listed there.)—P0*
28backup_get_statusbackupRUnit → BackupStatusData{lastBackupMillis?,lastResult≤80,scheduled:Boolean,nextPlannedMillis?} — status scalars only. No restore, no backup trigger, no file lists, no key material (§5). Contracts: library/intents/backup/ + backup/intents/GetStatusIntent.kt.~300 chP2

3.3 News worked example (the shape every proposal follows)

User: "What's happening in tech, and summarize the main story."

  1. news_top_stories{category:"TECHNOLOGY", limit:5} → 5 headlines with

storyIds, ≤ 3.5k chars total. The model picks one.

  1. news_get_story{storyId} → server one-liner + ≤ 8 member headlines

across sources (~2k chars) — enough to summarize coverage.

  1. Only if the user wants depth: news_read_article{url, offset:0} →

≤ 3,000 chars of extracted text; further pages via offset (the web_read contract). At no point do 500 cached articles, the full feed JSON, or a whole extracted body enter context.


4. Apps deliberately skipped (and why)

App(s)Why no intent
passwordsVault contents must never enter an LLM context — credential exfiltration by design. No search, no get, no exceptions. (Autofill already serves the user without the assistant.)
euiccPrivileged LPA: profile enable/disable/delete/download are carrier-grade, irreversible-ish acts. The existing EsimLink deep link is the right surface.
vpnConfig import/connect state is security posture; an assistant toggling a tunnel or reading per-app bypass creates risk with near-zero conversational value. At most a future read-only vpn_get_status{connected,configName≤60} — P2 backlog, not proposed.
updaterA/B OTA apply/reboot is privileged and irreversible; status is already surfaced by system notifications. No tool.
parentalcontrolsPIN-gated supervision controls. Bypassing the PIN via assistant — even read-only rule dumps — defeats the product. Skip entirely.
emergencyLockscreen medical/SOS surface. Reading medical info into chat is a privacy regression; triggering SOS is dangerous. Skip. (Health §3.2 #2–3 covers the user's own, unlocked, in-app health queries.)
backup (actions)Restore/trigger/key handling excluded; only the scalar status read in §3.2 #28 survives, P2.
cameraCapture is a physical, permission-gated act with viewfinder state; "take a photo" via a headless intent produces blind photos and privacy surprises. Recent-photo questions belong to photos metadata search (#10).
keyboard, speechIMEs and speech engines are system services already invoked directly by the user/OS. speech output via assistant adds a lossy hop; use device TTS settings instead. No tool.
launcher, setupwizard, watch, auto, cast, share, networklocation, measure, tuner, logviewerSystem plumbing / one-shot surfaces / hardware-in-the-loop tools. No conversational query or safe action: launcher state duplicates get_app_list; setup is one-time; watch/auto/cast are transports; measure/tuner need live sensors in hand; logviewer output is exactly the massive-data case (logcat) — a future logviewer_get_recent_crashes{limit=3, excerpt≤500} is conceivable but P2 backlog, not proposed here.
games/* (all 12, except hub summary #25)Game state (boards, hands, positions) is large, fast-moving, and useless in text form; no safe action. Hub aggregates are the only assistant-shaped data.
everysyncSync engine; its sinks (notes/todos/contacts/passwords) are already covered by the sink apps' tools. Exposing vault metadata adds attack surface for no user question it answers better than the sink apps. Password-vault sync: doubly excluded (see passwords).
findfamily-ios, apple/*SwiftPM/xtool target, not an Android AssistantIntent host. Out of scope for this mechanism.
openassistant itselfAlready the dispatcher; internal tools (memory, web, device, render_ui) are §1.1. No self-intent.
codeFile contents are unbounded and workspace-shaped; "search my project" needs a repo-scoped design (and leaks code into chat by default). Revisit only as code_search_symbols{query,limit} with path/title hits — P2 backlog, not proposed.
things (actions), health (writes), travel (booking), fooddelivery/shop (checkout), appstore (installs)Actions excluded or handoff-only — see §5. Reads proposed where safe.

5. Privacy & safety rules (binding on any implementation)

  1. Money never moves. No place-order, book, pay, install-with-payment,

or checkout-creation tool — the existing food/shop HANDOFF_PREP pattern (priced summary → user acts in-app) is the ceiling. Travel follows it: trips are read-only; booking stays in travel.

  1. Sends are confirm-gated or handoff. send_message_v2 already

requires WRITECONFIRM. New message/email creation is composer-handoff (#26) — never silent send. The legacy device `sendmessage` (§1.3) should be retired or reclassed when next touched.

  1. Deletes: none proposed. No delete-note/contact/event/photo/file/

order tool in this audit. Cart-line removal (existing, local, light) and bookmark toggle (#news, WRITE_CONFIRM) are the outer limit.

  1. Location is sensitive. get_family_locations already returns live

coordinates — keep it, but any new location-shaped tool must return place names first and coordinates only when the caller already holds them (the maps_search_places proposal takes optional user-supplied coords, it does not read family location).

  1. Health & education are read-only aggregates. No FHIR record

export, no medication edits, no learner answer history. Results are numbers/schedules the user already sees on their dashboard.

  1. Credentials & vaults: absolute exclusion (passwords, backup keys,

euicc profiles). Not read-only, not "just metadata" — nothing.

  1. Provider-side validation is mandatory. Every proposed intent

clamps limits, validates enums/ranges, and truncates text in the target app (the food/shop/communicate backend pattern), because the catalogue spec is model-facing text, not enforcement. Co-signed caller

  • the app's ACCESS_* permission where the app already has one

(communicate/shop/fooddelivery pattern); add the permission for news/ health/photos on first implementation.

  1. No silent triggers. Intents read the local cache/store; they do

not kick off syncs, refreshes, scans, or downloads (30 s launcher timeout; stale data with an honest timestamp beats a hang).


6. Priority summary

P0 (do first): News read trio (news_search_headlines, news_top_stories, news_get_story + news_read_article), the §3.1 flood retrofits (search_notes, email split, music/calendar/todos caps), maps_search_places, health_get_metric_summary, health_get_medications, flashcards_get_due_summary, translate_text, calculator_evaluate, calculator_convert_unit, travel_get_trips.

P1: screentime_get_usage, photos_search_photos, astronomy_get_tonight, web_get_bookmarks, web_search_history, youpipe_get_subscriptions_latest, files_search_files, appstore_search_apps, appstore_get_updates, education_get_progress, get_weather_forecast, maps_get_saved_places, music_get_now_playing/music_get_playlists, flashcards_search_cards, news_get_bookmarks/news_set_bookmark.

P2: office_list_recent_documents, things_get_hydration, games_get_achievements_summary, email_draft_email, backup_get_status. Backlog-only (named, not designed): vpn_get_status, logviewer_get_recent_crashes, code_search_symbols.

Top 10 proposed tools (with hard caps)

#ToolAppCap that keeps it safe
1news_search_headlinesnewslimit ≤ 10; title ≤ 160 ch; one-liner ≤ 200 ch
2news_top_storiesnewslimit ≤ 10; category-filtered; feed-ranked
3news_read_articlenews3,000-ch excerpt pages by offset; never whole body
4maps_search_placesmapslimit ≤ 10; name/address ≤ 120 ch
5health_get_metric_summaryhealthaggregates only; zero raw records
6translate_texttranslateinput ≤ 1,000 ch; output ≤ 2,000 ch
7travel_get_tripstravellimit ≤ 10; summaries only; no PII fields in DTO
8flashcards_get_due_summaryflashcardscounts only; zero card text
9news_get_storynews≤ 8 member headlines; one-liner ≤ 300 ch
10calculator_evaluate / calculator_convert_unitcalculatorexpression ≤ 200 ch; scalar results

7. Verification of this audit

Read-only. Sources: AssistantToolSpecs.kt (54-row catalogue), AssistantTools.kt handler map, AssistantCoreToolIntents.kt / AssistantToolIntents.kt (launch targets + summarizers), all 17 library/intents/* DTO files, per-app intents/ listings, provider caps grepped in notes/contacts/calendar/todo/email/music/findfamily/ communicate/fooddelivery/shop/weather (MAX_RESULTS, DAO LIMIT 30, backend MAX_*_LIMIT, summarize* truncations), NewsRepository/ Story/NewsSearch/CachedArticle for the news design, repository signatures for health/flashcards/travel/youpipe/web/appstore/education, and PromptBudgetTest (24,500-char header budget). No builds were run — no code changed.