Toolbox: the workspace's saved code
toolboxThe workspace's Toolbox: code and animations saved by earlier builds, for reuse.
BEFORE writing a helper (chart layout, counters, text effects, easing, a data transform) or a scene the team has made before: toolbox({action: "find", query: ""}), then get the best match and use it.
Using an item: JS helper -> require("toolbox/") in run_script; Python helper -> a first line "# use: " in run_code; page JS/CSS -> get returns its API, and get with include_code: true returns the code to copy into the site as is (don't retype it); an animation -> animation.place({animation, project_id, clip_index}).
AFTER writing something another video could use: toolbox({action: "save", name, code | animation, summary, tags, usage}). The language is detected. Saving a name again adds a version; old versions stay, so nothing built on them changes. A save that reads like existing items lists them (similar): use or improve one of those instead of keeping a near-copy.
Saving, removing and protecting need an editor or admin; a protected item changes only for its owners or an admin.
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": {
"action": "<action>"
},
"name": "toolbox"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rev | No | get: a version other than the latest. | |
| code | No | save: the helper's source. JS for run_script is a CommonJS module (module.exports = {...}). | |
| kind | No | find: only code or only animations. | |
| name | No | get/save/remove: the item's name, lowercase-with-dashes ('bar-layout'). get takes 'name@3' for a version. | |
| tags | No | save: a few search words. | |
| entry | No | save: the page of a multi-page animation. | |
| limit | No | find: how many (default 10). | |
| query | No | find: what you are about to build, in words ('bar chart race', 'logo intro'). | |
| usage | No | save: how to call it -- its functions and arguments, an example. | |
| action | Yes | find: search the workspace's saved code and animations. get: one item's code. save: add an item (or a new version of a name). remove: take a name out. protect: only its owners or a workspace admin may change it from then on (protected: false lifts it). | |
| owners | No | protect: the user ids who may change it (default: you). | |
| dry_run | No | save: say what would happen, change nothing. | |
| summary | No | save: what it does and when to reach for it (find searches this). Required. | |
| language | No | find: only this language. save: only to correct the detected one (js = run_script, python = run_code, page = JS/CSS a page copies). | |
| animation | No | save: an animation of the project to keep (a COPY goes to the workspace library). | |
| protected | No | protect: true (default) to protect, false to lift it. | |
| element_id | No | save: the animation element to keep instead. | |
| project_id | No | save of an animation: its project. | |
| include_code | No | get: also return a page item's code (left out by default: copy it into the site with it, don't read it). |