inspect_canvas_libraryfinds the components and templates a block can use.edit_canvas_blockscreates a block or changes a saved one.validate_code_blocksrenders saved blocks in a browser and reports what it saw.inspect_canvas_blocksreads saved blocks.
build-visualizations skill through inspect_skills before you add a Canvas block; it owns design guidance. Page order and block removal belong to edit_pages, and editable model tables to edit_table_blocks.
Find components and templates
Callinspect_canvas_library with a list block whose query is a few search words:
- An entry matches when any one word appears in its title, description, tags, aliases, or decision outcomes.
kindnarrows the list tocomponentortemplate. Withoutquery, the list holds every entry of that kind.
read the entries you plan to use. One read takes up to 16 targets and resolves templates and components together, so a template and the components it needs come back in one call:
read returns each entry’s instructions, its props skeleton, and its runtime requirements. The shared Canvas visual contract follows the last entry of every read, components and templates alike, and overrides any conflicting styling in a template’s own instructions; a visual component or template also carries the full runtime_contract once. A name that matches nothing, or more than one entry, comes back as an unresolved entry. Library entries are building guidance; they are not saved blocks and prove nothing about how a block renders.
Create a Canvas block
edit_canvas_blocks create requires page, title, and source:
pageis the Page that receives the block, by name or asinspect_pagesprints it.after_blockplaces the block under another one; without it the block goes last.titleis the block’s name. Later updates and page edits name the block by it.source_templatestands in forsource:{"publication", "version"}, andfilefor a workspace template’s Canvas file such ascanvas/summary.jsx, copy a published template’s Canvas code exactly as published as the block’s source. Acreategivessourceorsource_template, not both.- The receipt names the new block two ways.
targetis the block’s name-form selector, which the page and Canvas tools accept wherever they take a block astarget.refis the block’s pasteable reference, such asPipeline by stage#a74, which they accept wherever a result’s block reference is accepted, such asreorder_blocksblock_order. The reference keeps naming the block in lateredit_pagescalls even after a rename. - The receipt also carries
dataset_evidence, one series and one row per dataset as the block receives them, andsource_notes. A dataset still calculating when the result was due is listed withstatus: "unavailable"anderror: this dataset’s calculation had not finished when this result was due, so it was stopped. A dataset whose Scenario access check was still running at that moment reads this dataset’s scenario access check had not finished when this result was due, so no access decision was made and the dataset was not read; one that names a Scenario the person cannot read reads scenario access denied; any other failure of that check reads authorization check failed: followed by the cause. The block is saved either way, and the other datasets keep their evidence.
What the source must be
source is one complete component, Block({ data, timeSettings, theme, state, action, emit }), run in a sandbox:
- React is injected. Reach hooks through it, such as
React.useState(...); a bareuseState(...)is refused, andwindow.Reactis unavailable. - Imports, network access, and direct AgCharts are forbidden. Custom font families are refused.
- A component declared inside
Blockand rendered as JSX is refused on acreate.Blockdeclares a new function for it on every render, so React remounts it. The refusal names each component:<Tip />is declared inside Block and rendered as JSX. Block declares a new component function each time it renders, and React remounts a component whose function changes: a chart redraws and loses its measured size and hover state, and an input loses focus. A component declared at the top level of the source, outside Block, keeps its identity across renders and receives values through props. Several components open<Tip />,<HoverMark />and<AreaChart />are declared inside Block…. A capitalized helper the source calls as a function,RevenueLine(row), passes, and so does a component created inside aReact.useState,useReducer, oruseRefinitial value, an effect, or aReact.useMemoorReact.useCallbackcallback with an empty dependency list; auseMemooruseCallbackcallback with dependencies is still scanned. The only exception is acreatewhosesource_templatecopies a published template’s code exactly; that code is taken as published. - An
updatethat changes the source throughsourceorsource_patchesrefuses only the inner components the saved source does not already declare insideBlock, so a data-only refresh of a block that already has them saves. Components are matched by the name the source declares them with, one per declaration: renaming one, or adding a second declaration with the same name, counts as new and is refused with the same text, which names only the new ones. The kept components are stated in the receipt’ssource_notes:<Tbl />and<Bridge />are declared inside Block, as in the source saved before this update. Block declares a new component function each time it renders, and React remounts a component whose function changes: a chart redraws and loses its measured size and hover state, and an input loses focus. An update that keeps the saved source, such as a title or dataset change or a resubmitted identical source, runs neither check. - An element of the block may go full screen. Every Canvas frame carries
allow="fullscreen *", soelement.requestFullscreen()works from a click in the block, such as a Present button on a slide deck. The backdrop behind the full-screen element is the theme’s surface color rather than the browser’s black, and an element taller than the screen scrolls. This includes the whole page: a block that callsdocument.documentElement.requestFullscreen()gets the theme’s surface behind it and scrolls when taller than the screen. Ari’s validator frame allows full screen for page and form renders, sodocument.fullscreenEnabledreads the same there as on the Page; an email render has no full screen. The sandbox’s other rules do not change. print()prints only that block’s frame.- The injected components, their props, and the rest of the runtime contract are in the
sourcefield’s description in the tool schema, and each component’s props ininspect_canvas_libraryread. - Controls are ordinary HTML, drawn by the Canvas stylesheet in light and dark mode:
<button>for actions,<input>for text, numbers, dates, times, and months,<select>or radio inputs in a<fieldset>for choices, a checkbox for an on/off value (role="switch"draws it as a switch),<input type="range">beside an<output>, and<textarea>. A button’sdata-variantofaccent,ghost, ordestructivesets its emphasis,data-ari-actionmarks a button that starts Ari work, anddata-variant="segmented"on a container draws its radio labels as one segmented track. The library no longer lists control components; a saved block that still callsButton,InlineButton,Select,SegmentedControl,Toggle,Checkbox,Radio,RadioGroup,TextInput, orTextAreakeeps working, drawn as the native element.FieldandSliderremain components. <input type="file">lets the person pick a local file, which the block reads in their browser withFile.text()orarrayBuffer(). The file never leaves the frame; Ari receives only what the block passes on, such as text in astartAriChatmessage of at most 4,000 characters.Gridstacks its columns when the block is narrower thanminColumnWidth, and also when a column’s content is wider than the column, with or withoutminColumnWidth. It cannot shrink that content, so a fixed-width row, a fixed table column, or text that does not wrap needs a layout that fits a 360 px phone or a deliberate horizontal scroll.
Datasets
A dataset is a live, read-only table read that the block receives asdata.<name>. A block holds up to 8.
The block receives the read inverted: each row of the layout becomes a series, and each column becomes one entry of
data.<name>.rows, one plotted point. A layout with columns: [] and window.granularity: "NO_GRANULARITY" declares timeless values: one row holding each Variable’s value.
On update, each datasets entry adds a dataset or replaces the saved one with the same name, and the others stay. Leaving datasets out keeps them all; [] clears them all; remove_datasets removes the ones it names.
Values a dataset row carries
Each row carries each Variable’s own value under its series key:row.date is a display label, and periodStart, when present, is the ISO start of the period. A dataset that failed has empty rows and series and an error string. A comparison dataset also carries scenario.label, scenario.isCurrent, and scenario.lastClose, and timeSettings.lastClose is the current Scenario’s close date or null.
Colors and the theme
- Colors and type from
theme.tokens,theme.design, or--cb-*CSS variables follow the viewer’s light or dark mode. theme.tokens.surfaceand--cb-surfaceare transparent, because the Page paints the background behind the block.theme.tokens.surfaceRaisedand--cb-surface-raisedare the theme’s opaque raised color, for dialogs, popovers, and other overlays;control.surfaceandchart.tooltipSurfaceshare it, and--cb-overlay-backdropcarries the dimming color behind an overlay. A nativedialogelement gets a themed surface, text color, border, corner radius, and dimmed backdrop by default; its own styles still win.- A literal or named color, including one in a palette, keeps its value in both modes. The write saves it, and the receipt’s
source_notesnames the first one: “<color>on line<n>is the first fixed color in this source: it keeps this value in light and dark mode. Colors from theme.tokens, theme.design, or —cb-* CSS vars follow the viewer’s mode.” - Headings take their typeface, size, and weight from the theme:
h1toh6and theheadingandtitlevariants ofTextread--cb-font-heading,--cb-text-headingor--cb-text-title, and--cb-weight-semibold, and astyleorclassNamechanges these only by setting those values. Their color is the author’s to set:h1toh6inherit the color of the text around them, theTextvariants usetext.default, and a color in their ownstyleorclassNamereplaces either, so a white heading on a dark panel stays white. - A workspace brand can set the heading typeface, the accent color, and the corner shape. A block follows the brand through
theme.tokens.fontHeadingor--cb-font-heading,theme.tokens.accentor--cb-accent, andtheme.tokens.radiusor--cb-radius, in every workspace it is copied to.
Change a saved block
edit_canvas_blocks update names the block with target, by name, ID, or as inspect_pages prints it. Fields you leave out keep their saved values, and the block keeps its identity and position.
sourcereplaces the whole component. It requiresbased_on: thesource_hashof theinspect_canvas_blocksread or theedit_canvas_blockswrite the source was written from, 64 lowercase hex characters. The update saves only while the block’s saved source still has that hash. When another writer saved the block in between, the refusal reads the block’s saved source is no longer the source whose source_hash this update names in based_on, so this source was written from an older copy. This update saved nothing, so the block keeps its current source.; read the block again and redo the edit on the current source. Saves of the title, datasets, or display state do not change the hash. Asourcewithoutbased_onis refused.source_patcheschanges part of it: a list of up to 50 exactoldtonewtext replacements, applied in order. Eacholdmust occur exactly once in the source as the earlier patches left it. The block saves only when every patch applies. Patches apply to the current source and take nobased_on.- Every create and update returns each block’s
source_hash, so the next whole-source update can name it. titlerenames the block; an empty string clears the title.page, when given, confirms the block is still on that Page.- An update that leaves the block exactly as it was saved, such as a patch whose
oldequalsnew, or a resubmitted source, title, and datasets, saves nothing and records no change: the item’s status isunchanged, the receipt isno_opwithstate_changed: no, and there is nochange_log_id. Withvalidate: truethe block is still rendered as saved, and the validation note opens The block already held what the update asked for, so nothing was saved.
Check that a block renders
A saved block compiles, but only a browser shows whether it renders.- A Canvas write that no browser rendered returns a
render_unverifiedwarning: The block is saved and compiles; whether it renders is proven only when validate_code_blocks opens it in a browser. validate: truebeside the write returns the browser’s result for the saved revision undervalidationinstead. A render check that fails or is unavailable leaves the edit saved. The dataset readback and the render check share one answer deadline, about 10 seconds before the call’s 119-second limit, so the receipt arrives instead of a timeout. If validation has not finished when the result is due,validation.notereads The Canvas edit saved. Browser validation had not finished when this result was due, so it was stopped and the render was not observed. If the result is due before validation begins, it reads The Canvas edit saved. This result was due before browser validation began, so validation did not run and the render was not observed. In both casesvalidation.enabledisfalse, as it is whenever no browser render was observed, including when the check is switched off or unreachable; readvalidation.noteto tell the causes apart. The receipt carries therender_unverifiedwarning, and the saved block stays saved.validate_code_blockschecks saved blocks on their own:
What validate_code_blocks reports
- It renders up to 8 blocks per call in Chromium, with live calculated datasets, once per theme (light and dark). Each render uses the block’s saved state, Scenario, number formats, and Last close, in a frame 1200 px wide. Each result names the revision and source hash it rendered.
- The result’s
observedsentence states what the check saw, such as: “Each block was rendered once per theme, with its saved state, in a 1200 px wide frame. Errors, warnings, plotted chart values, guide anchors, and any visual review come from those renders. Clicks, typing, links, and guide launches did not run, so what they do is unobserved. The light render was also laid out at 360, 600, 760, 900, 1100, and 1400 px wide to look for overlapping or spilling text; the layout at other widths is unseen.” - A block that rendered cleanly carries
plotted: one entry per chart the render drew, withchartnaming the chart by its title, when it has one, and its source position, such asChart "Pipeline" at source L12, andseriesholding one entry per numeric value field of every visible series, withname,count, and thefirst,last,low, andhighplotted points as{x, y}. The values are the ones the chart was given. The chart draws stacked and normalized series, waterfall running totals, and histogram bin counts from them, so the drawn shape of such a series differs from the list. - A warning that begins Design: names an element that wears a generated interface’s default and what to change, with its source position when it has one: cards nested in cards, a colored side stripe, gradient text, a colored glow shadow, a small uppercase label above a heading, text under 11 px, text under 4.5:1 contrast (3:1 for large text) against its painted fill in an authored color, a font size off the Canvas scale of 12, 13, 14, 18, and 32 px, motion that bounces or never ends, and an emoji used as an icon. A finding that repeats ends This repeats in N places.; at most twenty are reported per render, and none blocks the save.
- Errors are failures the render reported: runtime errors, widget errors, a stalled render, console errors, and failed element loads. Warnings may be intended: console warnings, blank or error-code cells, empty or zero-only data, missing series keys, hidden series, and content past the frame’s edge. A warning also names text that overlaps or spills out of its box when the light render is laid out at 360, 600, 760, 900, 1100, and 1400 px wide, with each width, element, and source position, such as At 360, 600, 760 and 900 px wide, text overlaps: td “Orbitline Dev Pvt Ltd” at source 464:0 and td “OD-317” at source 465:0, in 8 places.; up to six such warnings are listed with a count of the rest. Fix one before handing the block over: stack columns with
GridminColumnWidth, let text wrap, or give a wide table a deliberate horizontal scroll. - A clean render does not check that the values are financially correct.
- A control that opens a closed part of the block names the anchors it reveals with
data-guide-reveals="liquidity holdings"and keepsaria-expandedcurrent. A walkthrough step on an anchor the block does not draw clicks that control first, once, and never when it is already expanded; without such a control the step lights the whole block.validate_code_blockswarns, in both themes, when a Page block’sdata-guide-revealsnames an id that nodata-guide-anchorin the source declares. guide_targetslists the copyable guide anchors visible in at least one theme, andguideAnchorskeeps each theme’s visibility and ambiguity.guideAnchorslists at most the first 64 distinct anchor IDs per theme, in document order. When the render had more,guide_anchors_cutsays how many, andguide_targetsdraws only on the listed ones.visual_reviewreturns one block in one theme as an image. Withoutvieworviewport, it is the full Canvas at 1200 px wide, capped at 2400 px high.viewis a fixed opening, the area visible before scrolling:desktop-openingis 1100 × 700 CSS pixels andphone-openingis 320 × 650, after the host page uses part of the screen. Each fixed view also returns an independent design assessment of that image: a reading of its composition, hierarchy, typography, and color, withrevision, the one blocking defect, ornullwhen handoff can proceed, andrefinement, an optional change that leaves the reading intact.revision.kindisunreadable,overlapping,cut_off,wrong_data,missing_requirement, orauthoring_note, andrevision.evidencesays what in the image shows it. A preferred arrangement is not a missing requirement, and a direct label that shows a saved value in the model’s own precision is not a defect. A note about the work on the page, such as what was checked, what a preview covers, or where a number came from, is anauthoring_note: the assessment asks for its removal, because that text belongs in chat.brief, up to 2,000 characters, tells the assessment what the opening is designed to show and the choices already settled for it, such as “EBITDA is the bridge’s endpoint, not a headline figure”; it needs aviewand is refused without one with visual_review.brief has no view to apply to. A structured model call makes the assessment in a fresh context, billed to the workspace like a chat turn, separate from the render facts. For a non-nullrevision, make one repair, then one confirming review with the same target, view, and brief, and stop after it whatever it reports: tell the person about a remaining defect rather than treating it as fixed. Arefinementneeds no repair and no further review. The phone opening is 320 px wide, narrower than the 360 px the overlap warnings start at, so review the phone view when a block must fit a phone.viewportis a measured Canvas area,widthandheightfrom 1 to 1600 CSS pixels: the width lays out every selected block, and the height crops the image without changing the content’s height.framingreports the dimensions and image scale. A call takesvieworviewport, not both.
When a render does not happen
Errors a person’s browser reported
When a person’s browser hits a runtime failure while rendering a saved block, it reports the error for that exact Scenario, block, and source revision.inspect_pages read then returns it as the block’s render_error, and a later successful render clears it. An MCP call has no browser of its own, so a block nobody has rendered has no such report. A missing render_error does not mean the block renders.
Read saved Canvas blocks
inspect_canvas_blocks takes target, a block name, ID, or reference, or a list of related blocks, and optionally page to constrain them. It returns each block’s exact saved source, its source_hash (the hash of the whole saved source, also when the source comes back in part), dataset layouts and Scenario bindings, display state, position, revision, and references. All blocks are read at one snapshot, the latest unless as_of_point names an earlier one. It does not calculate datasets, and saved code is no proof of a successful render.
dataset_layouts holds each dataset, by name, as the edit_canvas_blocks datasets entry that saves it:
name,scenario,layout, andwindow.scenariois the bound Scenario’s current name, and is absent when the dataset follows the Scenario in view, the rule the write applies.layoutis written as Canvas dataset layouts declares it: items ininclude, a breakdown level as its Dimension name, a fork asbranchesnumbered by path with the shared levels under every path inafter_branches.- An entry with a
layout, sent back unchanged in anupdate, saves the same dataset, with its Scenario binding and window; the read carries none of the saved-table read fields (signature,signature_status,prompt,presentation), which the write refuses. - A saved layout with structure a Canvas write has no field for, such as a saved format, a spacer row, or declared items, comes back with
layout_problemnaming the entry in place oflayout. datasets(the saved ids) anddataset_scenariosare unchanged.
- Each run of 1,000 or more encoded characters in a source, such as base64 or hex, reads as
[[N encoded characters not shown]]. - A source still too large comes back in part.
source_partgives the byte range it covers, and the next call passesnext.source_offsetassource_offset. not_returnedlists the selected blocks left out, with their sizes, andnextholds the arguments that read the rest.
Links a block opens
On a user click,emit({type: 'navigate', url}) opens a page or block link that a tool result returned, or another app address in the current workspace, through normal browser history. It keeps Scenario query parameters and #block-anchor-<block-id>. External addresses and public share views are not supported. The source field’s description covers the block’s other actions, such as saving presentation state and starting an Ari action.
Name blocks in page edits
edit_pages arranges and removes blocks, including Canvas blocks.
- A block action names its Page with
page. add_textmay omitpage. It then uses the Page of anafter_blockreference it was given, else the Page in view, else the Scenario’s only Page. When none of these settles it, the call is refused: with several Pages, with no target page and up to 20 of them as candidates, and its hint gives the Scenario’s page count and how many are listed; with no Pages, with this scenario holds no pages.update_textanddelete_blockmay omitpage; they then use the Page in view, and a returned block target finds its own Page.reorder_blocksnames the Page it arranges withpage, or withtarget.block_orderis the complete top-to-bottom order, with each visible block once, by name or by the block references other results print.placemoves one block instead:block,after_block, andto_pageto move it to another Page.- A Page a person has opened in the Page editor has a saved document: its text as prose, with one entry for each block in reading order.
reorder_blocksarranges the block entries inside that document and leaves the prose where it is. The largest set of blocks already in the requested order keeps its places; each other block moves directly below the block before it in the new order, or directly above the first unmoved block when it comes first, so a Page’s opening text stays at the top. Withplace, the named block is the one that moves, even when moving a neighbor would give the same order, and prose nested under it stays where the block was. Aplacewithto_pageonto such a Page adds the block’s entry to the destination document directly below itsafter_block, or last without one. The one order refused is one that would put a block between another block and the content nested under that block: invalid block order: the order puts a block between another block and the content nested under it. - A
delete_blockaimed at a block that another saved change already deleted answersnot_foundand changes nothing. Its message names that change and, when the block went with its Page, the Page:Block <id> is already deleted in scenario "Main": saved change <n> deleted it together with its page "<name>". This call changed nothing.The result carriesblock_id,layer_id, anddeleted_by_change_log_id. delete_blockrefuses to delete objects that lose their last table occurrence while formulas, other blocks, settings, or hand-added items depend on them.force: truedeletes them anyway, and those references break. Objects still shown on other tables are kept.
inspect_pages, see Pagination and truncation.