Agents & MCP
Results, revisions and the verification loop
On this page5 sections
The envelope
Every tool returns one JSON object (also in structuredContent):
JSON
{"ok":true,"summary":"Inserted 3 nodes","doc":{"id":"d_…","path":"/…/site.kimo","dirty":true,"readOnly":false},"revision":{"before":{"epoch":"k2","seq":11},"after":{"epoch":"k2","seq":12}},"created":[{"key":"card","id":"Hq3Lm9aZ1x"}],"changed":["Hq3Lm9aZ1x"],"undoToken":"u_…","warnings":[],"data":{…}}
On failure: {"ok":false,. Nothing was committed. Branch on
code, read suggestion, and retry automatically only when retryable is true.
Revisions and docIds
revisionis{epoch, seq}. Pass the latestrevision.afterback asbaseRevision. If anyone changed the document since then, you getREVISION_CONFLICTwithdetail.currentanddetail.changed(ids). Re-read those nodes, then redo your change.docIdstays the same while the file stays open. A reload (external edit, git checkout) mints a new one, and old ids fail withDOCUMENT_NOT_OPENplusdetail.currentDocId. Switch to it and re-read.
Safety
dryRun: trueonkimo_apply_ops/kimo_importvalidates and returns ops and warnings, and commits nothing.- Destructive ops (
delete,replace,detach,remove_prop,delete_variable, axis deletes) may need a higher permission level or the user's approval. A denial isPERMISSION_DENIED, so don't retry it in a loop. Ask the user, or change approach. - Your permissions (level
read/edit/edit+delete, file allow-list, grants) are inkimo_get_state. Files outside the allow-list ask the user every time. kimo_history {action:"undo", token:<undoToken>}reverts exactly your call, and only if it is still on top of your stack. It never undoes the user's or another agent's work.
Verification loop
After each meaningful write:
- Problems. A
kimo_apply_opsresult carriesdata.problemswhen the layers it changed have clear problems (empty frame, text overflowing or clipped, zero size, outside its parent, missing variable, invisible shape). Fix them in the next call. - Render.
kimo_render {docId, ids:[frameId]}(orrender:trueonkimo_apply_ops). It always shows the committed state. Look for clipped text, overlap and wrong spacing. - Measure.
kimo_query {select:{ids:[…]}, include:["bounds",. Compare the actual boxes with what you intended."problems"]} - Validate.
kimo_validate {docId, check: true}reports schema errors, lints (missing variables, invisible text, circular sizing, unresolved overrides) and the design problems of the whole document, placeholders still set included. Finish with none. - Fix with a small follow-up call, then repeat. Stop when render, bounds and validate all agree.
warnings in a successful result are lints that your change introduced. Fix them before you
move on.
Saving
kimo_save {docId} writes atomically and reads the file back. data.bytes/sha256 are reported
only after verification. The app (and headless kimo mcp) also autosaves after 2 s idle.
kimo_close refuses a dirty document unless you pass save:true or discard:true.