askOmni answer in your own chat. Your backend gets the chart as an interactive page, and your app shows it in a frame. The page has hover tooltips, a chart-type picker, and a table view.
Requirements
To follow the steps on this page, you’ll need:- A finished setup, so your backend can mint an MCP token for the user
@omni-co/embedversion 1.3.0 or later installed in your frontend- The
jobIdfrom a completedaskOmniresult
Show a chart
Get the chart page on your server
Get the page with the user’s MCP token or with an organization API key, then send it to the browser.
- MCP token
- Organization API key
Call the The result’s
getJobChartPage tool with the user’s MCP token and format: "html". The token reads only that user’s jobs.Your server
structuredContent has the HTTP status of the request and the page in body. Pass body to mountOmniFrame as html in the next step. If the call fails, error gives the reason, so show a fallback.The tool refuses a page over 200,000 characters. If it refuses, ask the question again with fewer rows, then get the chart with the new job ID.Call this tool from your own code. If your LLM calls it, the full page goes into the LLM’s context.Show the page in your app
Call
mountOmniFrame from @omni-co/embed/browser.Your page
mountOmniFrame does the following:- Frames the page in an iframe sandboxed to
allow-scriptsonly. Don’t addallow-same-origin, because it gives the page your page’s origin. - Sizes the frame from the page’s
sizeevent. - Calls
onErrorand removes the frame when the page sends anerrorevent (page_error), or doesn’t report its size within 15 seconds (start_timeout). Astart_timeoutusually means your Content Security Policy blocked the page’s script. - Removes the frame when you call
destroy().
mountOmniFrame also frames a signed embed URL, with { url: signedEmbedUrl }, and sizes embedded dashboards and apps to their content.Content security policy
The page runs under your page’s Content Security Policy. Allow these:script-srcandstyle-src: Omni’s asset origin, which is the origin of the page’s<script type="module">worker-src:blob:img-src:data:
Next steps
- See all chart page options in Render AI job visualization
- Learn about the
sizeanderrorevents the chart page sends

