portfolio-overview
Portfolio Overview
Produce a cross-property view of the account: which sites carry the traffic, which lost the most, how each client tag performs, and which property deserves the next deep dive. The user's request may contain a tag name, a number of days, a search type, a focus hint ("only client X", "which sites dropped"), or a tag or visibility instruction; honor it when present.
Workflow
-
Inventory the account. Call
get_account_info(no arguments), thenlist_sites(no arguments), and read:- from
get_account_info:user,googleAccounts(each withemail,isPrimary,scopes,connectedAt),subscription(plan,status,currentPeriodEnd,cancelAtPeriodEnd, or null),access.levelandapiKey.scope, which tells you up front whether the writes in steps 6 and 7 will be refused. If the response carrieswarning, a read failed: relay it and do not tell the user to connect Google or subscribe on the strength of empty fields. - from
list_sites: owned properties first, then shared ones, each bysiteUrl. Each row carriessiteUrl,tags,dataSource,permissionLevel,readable,activatedand, when known,gscScope; a shared row addssharedBy(the owner) andaccessLevel(READ_ONLYorFULL). - the readiness flags:
readable: falsemeans the property is listed in Search Console but not verified, so every read of it fails until the user verifies it;activated: falsemeans an owned property is neither on the dashboard nor synced, so the other tools refuse it and the portfolio tools leave it out. Count owned, shared, unreadable and not-activated properties for the account line. - the empty and error cases: if the list is empty, relay
emptyBecauseandnextStep; if the call errors with reasongoogle_account_disconnected, relay its message (reconnecting Google on the Account page fixes it; re-authorizing this integration does not).
- from
-
Set the window. Use
days: 28unless the user asks for another length (1 to 180). The portfolio tools take no dates: they countdaysback from today minus 3 (the Search Console lag) and compare with the same-length window before it, and each response states the exactrangeandcomparisondates, so quote those. GSC data lags about 2 to 3 days: never treat the most recent 2 days as complete, and if the newest days of a daily trend look low, say it is likely reporting lag, not a real drop.searchTypedefaults toweb(alsoimage,video,news,discover).