Preview a Porter report (renders with data — slow)
preview_reportRender the report against real data and return the preview plus diagnostics.
Right after an upload you usually do NOT need this: edit_report and
publish_report_spec already return the report's diagnostics and a
preview_url from the audit they ran against real data. On a report
that has not changed since, this returns that same audit in about a
second (cached: true, with audited_at) instead of rendering again.
Pass refresh=True only when the DATA may have changed since then (an
account was reconnected, a sync finished) — it forces a full render, which
is SLOW (5-30s or more). A cached audit with a license or authorization
refusal (account_not_accessible, license_*, reauth_required…)
is rendered again on its own: those are fixed outside the report (a role,
a slot, a reconnect), so the stored audit cannot show the fix.
Use it to validate the render or debug broken charts — not for routine
listing or metadata reads (use get_report for those). Because the
render already produces the logs, this ABSORBS the diagnostics: one call
returns a preview_url (an openable link to the rendered preview — give
it to the user), rendered_at, diagnostics (each a broken or
empty chart with severity, optional page_id/chart_id, a
message and a hint on how to fix it), cached and, when known,
audited_at (when the audit behind the answer ran). A page_id
always renders that page.
ready is true only when a preview exists AND no chart failed;
preview_available says whether the image exists at all. When
data_status is query_budget_exhausted the charts hit the report's
hourly query budget: do not edit or re-upload, retry after
retry_after_seconds.
page_id scopes the diagnostics only. The preview image is ALWAYS the
report's default first page (captured at build time), whatever page you
ask for: with page_id the result says so in page_note and gives a
page_url that opens the requested page — share that link for it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"report_id": "<report_id>"
},
"name": "preview_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | No | ||
| refresh | No | ||
| report_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||