Load Invention
load_inventionload_invention opens the in-chat player with a piece: it plays in the user's browser after they tap Play, with a reduced feature set (a preview), and may drop out. Use it only when no local Fyug tools are present; when they are, load the piece with them instead. Pass exactly one of json (a complete invention document as a serialized JSON string of at most 64 KiB) or ref (an exact ref from list_examples, which the player fetches itself), and optionally controls for the person to play (at most 16; one the piece lacks fails the call, naming it). A document gets check_invention's check first and fails with the same error; it also fails, naming what it used, when it needs something the browser lacks (a bundled sample its engine does not carry, or a module type it does not build). Succeeds with {playable, version, module_count, connection_count, controls}, plus not_run naming each script or agent module, which the player builds but does not run. While the player is open it offers tools that act on the piece it holds (list_controls, get_control, set_control, set_controls, apply_edits, get_invention, pause_invention, resume_invention, get_notes, which lists the notes it will play, and get_meters); it sends the levels at load and the controls the person changes (list_changed_controls lists them): a value the person changed is theirs, so do not set it back, and carry it into any new document. Nothing is stored.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "load_invention"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Exact ref of a bundled example, copied from list_examples. | |
| json | No | Complete invention JSON string (with modules, connections, etc.), at most 64 KiB. | |
| controls | No | Controls the player shows the person, at most 16, each a module id and a control key (describe_module lists a module's controls): each drawn as the local control panel draws it (a knob, slider or stepper for a number, a toggle for a switch, a segmented control or menu for a choice) and grouped by module. |