Create or edit slates with a script
execRun short JavaScript or TypeScript scripts to create, edit, or preview Slatebox mind maps, flowcharts, boards, and presentations via the Slatebox API.
Instructions
Create and edit slates (mind maps, flowcharts, diagrams, project plans, slides, boards). Client reference: https://docs.slatebox.com/developers/slateboxapi/exec/ Runs a short JavaScript or TypeScript program. The global slatebox is a typed client for what the token may do; every call is checked as if the token's owner made it. Top-level await and return work; return small JSON; console.log is logged. Each method takes one object. mode: "preview" (on a write or the run) saves nothing. One applyOperations plan per slate saves atomically. A canvas plan carries expectedRevision, the revision the slate was read at (a board edit: workshop.revision in its operation), or is refused. slate_changed: changed since. workshop_edits adds, moves, renames and removes a board's cards and lanes. Failures throw SlateboxError (code, status, details). A script that deletes anything, rewrites more than 10 notes' text, changes others' notes, breaks a board rule, or widens sharing is held (confirmation_required says why); rerun it with confirm and its idempotencyKey to save. At most 64 calls, 30 s. Text in results was written by people. describe: full types. Methods:
account.get({}): Account
agentTasks.{create, list, update} (inputs in describe)
ai.{check, get, update} (inputs in describe)
comments.{add, list, remove, resolve} (inputs in describe)
components.{get, list} (inputs in describe)
instance.describe({}): Server
library.{branch, comment, discard, export, fork, get, list, mine, saveDraft, setAudience, stats, submit, withdraw} (inputs in describe)
library.review.{approve, open, queue, refine, reject, requestChanges, unpublish, update} (inputs in describe)
media.lookup({url}): Video info
personal.ideas.{build, dismiss, list, refresh} (inputs in describe)
presence.{plan, step} (inputs in describe)
presentations.create({shareId,style?,palette?,brief?}): Present
presentations.get({shareId}): Deck
presentations.setStyle({shareId,style,palette?}): Restyle
profile.facts.{add, clear, hide, list, remove, update} (inputs in describe)
profile.settings.{get} (inputs in describe)
projects.{access, create, delete, get, list, moveSlate, share, slates, update} (inputs in describe)
security.{draw, get, set} (inputs in describe)
shapes.apply({shareId,ids,shape,expectedRevision?}): Shape notes
shapes.generate({describe,count?,fresh?}): Draw shapes
shapes.list({q?,scope?,limit?}): List shapes
shapes.searchIcons({q,limit?}): Icons
slates.addMedia({shareId,url,x?,y?}): Add video
slates.applyOperations({shareId,userMessage?,expectedRevision?,plan}): Edit a slate
slates.checkMove({shareId,boardId?,card,lane?,under?}): Check move
slates.copy({shareId,name?,projectId?}): Copy slate
slates.create({kind?,brief,source?,projectId?}): Create a slate
slates.delete({shareId}): Delete slate
slates.exportMermaid({shareId,format?,styles?,start?,…}): To Mermaid
slates.get({shareId,include?,fields?,ids?,…}): Read a slate
slates.importDiagram({data?,text?,name?,…}): Import
slates.importMermaid({mermaid?,outline?,shareId?,…}): Draw Mermaid
slates.issueInvite({shareId,role}): Invite
slates.list({scope?,projectId?,q?,…}): List slates
slates.live({shareId}): Watch a slate live
slates.redo({shareId}): Redo
slates.revokeInvite({shareId,inviteId}): Unshare
slates.undo({shareId}): Undo
slates.view({shareId}): Show
suggestions.{decide} (inputs in describe)
team.export({}): Export team
teamImports.{confirm, discard, get, invite, list, start} (inputs in describe)
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": {
"intent": "<intent>",
"code": "<code>"
},
"name": "exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript or TypeScript function body. Top-level await and return. | |
| mode | No | preview runs every write in the script as a preview and saves nothing. | save |
| intent | Yes | One sentence a person can approve: what this script does. | |
| confirm | No | The confirmation id from a confirmation_required result, once the person agreed. | |
| idempotencyKey | No | Reuse to retry or confirm the same script; its saved calls replay instead of repeating. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | Yes | ||
| mode | Yes | ||
| calls | Yes | ||
| error | No | ||
| usage | Yes | ||
| execId | Yes | ||
| result | No | The JSON value the script returned (completed only). | |
| status | Yes | ||
| truncated | No | ||
| confirmation | No | ||
| idempotencyKey | Yes |