report_builder
Reports and briefs skill low risk
Part of the Weekly Report Agent, Monthly Report Agent and Executive Report Agent.
What it does
Use for any 'plan a report' / 'what should a monthly report contain' / 'outline a weekly summary or executive recap' ask — it returns the report plan: the plan names the read tool for each platform, the metrics and the date range, and you pull the figures with those tools. Cross-platform skill-tool that returns a PLAN for a white-label, client-ready performance report (weekly summary or monthly executive narrative) over Google Ads, LinkedIn Ads and optional GA4. It pulls no data itself: the plan names the read tool per platform (Google Ads: gads_run_gaql_query / gads_get_campaign; LinkedIn: lads_run_ad_analytics / lads_get_campaign_analytics; GA4: ga4_run_report with keyEvents), the metrics (default impressions, clicks, cost, conversions), the date range (default LAST_30_DAYS), the white-label rules and the export tool (sheets_export_report). You then run those reads and write the report, following these accuracy rules so figures reconcile to each platform UI within +/-1%: Google money fields are micros (divide by 1e6); aggregate metrics are NOT segmented (segmentation multiplies rows - request without segments for totals, or de-dupe); GA4 uses keyEvents (conversions is the deprecated alias) via runReport v1beta; LinkedIn cost fields are strings (parse to number) and use format-appropriate metrics (LP CTR / landingPageClicks for Thought Leader and inbound-traffic formats, never blended across formats; content vs demo leads kept separate). For prior-period deltas, run the same reads for the preceding equal-length window. Say when each figure was pulled; if a figure cannot be reconciled, say so rather than guessing. White-label: no Claude/MCP branding, no unexplained acronyms. Read-only - no writes. Output: {success:true, data:{task, report_type, accounts, date_range, metrics, currency, sources:{google_ads, ga4, linkedin}, export_with, branding}, warnings}.
When to use it
Call this FIRST, before writing any report plan or outline yourself, whenever the user asks to plan, build or outline a report ('plan a report', 'plan a monthly executive report', 'what should a monthly report contain', 'what goes in our weekly client report'), a weekly/monthly summary, an executive recap, or 'how did the account do' across Google/LinkedIn/GA4 - including 'just give me the plan' - even without saying 'skill'. It returns the report plan (read tools, metrics, date range, white-label rules, export path); you then pull the figures with the read tools it names. Read-only; it never changes the account.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
accounts | array<object> | yes | Per-platform account refs, e.g. [{platform:'gads', id:'1234567890'}, {platform:'lads', id:'557124836'}, {platform:'ga4', id:'521375766'}] - echoed into the plan as given (not validated or normalized here); pass each id to its read tool. Never pool accounts across clients. |
report_type | string | no | Report kind, e.g. weekly_summary or monthly_executive (default performance_summary) - echoed into the plan; the metric set vs full narrative is yours to write. |
date_range | string | no | A plain string, not an object: a preset such as LAST_30_DAYS (default) or LAST_7_DAYS, or 'YYYY-MM-DD,YYYY-MM-DD'. Echoed into the plan for the read tools. |
metrics | array<string> | no | Optional metric list for the plan; default impressions, clicks, cost, conversions. Echoed as given (not validated here). |
currency | string | no | Display currency label, echoed into the plan (nothing is converted here). When writing the figures: divide Google micros by 1e6, parse LinkedIn cost strings to numbers, and label each account's own currency. |
include_ga4 | boolean | no | Add GA4 (ga4_run_report, keyEvents) to the plan's sources. Default false. |
branding | object | no | White-label assets (client name, logo). No Claude/MCP branding is ever emitted regardless. |
Safeguards
Policy
White-label only: no Claude/MCP branding, no unexplained acronyms; plain English. Every figure must reconcile to the platform UI within +/-1% and show a last-refreshed timestamp; if a figure cannot be verified or data exceeds the 3h freshness bound, say so explicitly — no silent or guessed numbers. Never blend ad formats or lead types; keep per-account isolation (no cross-account pooling). Read-only — no account changes are made.
Reminder
If a number can't be reconciled to the platform UI or is stale (>3h), surface it rather than guessing; keep reports per-account and free of any internal/tool branding.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | A referenced Google Ads CID (or LinkedIn/GA4 account) is not found or not connected. | Verify the id (Google dashes stripped) and connection; remove or reconnect the account. | no |
MANAGER_ACCOUNT_METRICS | A Google CID is a manager (MCC) account; metrics are not reportable at the MCC level. | Report on serving child customer ids instead of the MCC. | no |
DATA_STALE | Underlying data exceeds the 3h freshness bound or last-refreshed is unavailable. | Surface the staleness in the report; refresh the source or annotate the figure rather than presenting it as current. | yes |
RECONCILIATION_FAILED | A metric could not be reconciled to the platform UI within +/-1% (likely segmentation multiplication or micros/string parse). | Re-pull without segments / fix micros(1e6) or LinkedIn cost-string parse; if still unreconciled, flag the figure as unverified — never guess. | yes |
RESOURCE_EXHAUSTED | Google Ads API quota/rate exceeded during the read. | Exponential backoff 5->10->20s (cap 60s), honor retryDelay, then retry. | yes |
RATE_LIMITED | LinkedIn returned HTTP 429 during adAnalytics reads. | Honor X-RateLimit headers / Retry-After; backoff and retry; alert at 75% of daily quota. | yes |
TOKEN_REVOKED | A platform OAuth token was revoked/expired beyond refresh. | Re-authorize the affected connection (needs_reauth) and re-run. | no |
PERMISSION_DENIED | Token lacks scope or account access for a requested source (403). | Re-authorize with the required scope or drop the inaccessible account; do not retry as-is. | no |
INVALID_ARGUMENT | Invalid date range or unsupported report_type/metric. | Surface the platform/validation message; correct the range/type — do not guess. | no |
PLATFORM_UNAVAILABLE | A platform API returned 5xx / transient error. | Retry the affected read once after backoff; if persistent, render a partial report and flag the missing source. | yes |
Edge cases
- Empty results for the period: return success with count:0 and a 'no activity' note rather than erroring.
- Google segmentation present: aggregate metrics multiply across segment rows — request without segments for totals or de-dupe before summing.
- Google money micros: divide by 1e6; never present raw micros as currency.
- LinkedIn cost fields are strings: parse to number before arithmetic; mismatch triggers RECONCILIATION_FAILED.
- LinkedIn adAnalytics caps: <=20 metrics, <=15k elements, no pagination — slice by date/pivot and merge to cover the range.
- Mixing formats: Thought Leader/inbound use LP CTR (landingPageClicks), never blended with raw CTR or other formats; content vs demo leads reported separately.
- GA4: report keyEvents (conversions is a deprecated alias); align attribution-window note.
- Prior-period delta when prior window has no/partial data: show delta as N/A with explanation, don't divide by zero.
- One source fails while others succeed: render a partial report, clearly flag the missing platform, do not silently omit it.
- Stale beyond 3h: annotate each affected figure with its last-refreshed time and the staleness warning.