library_add
LibraryFull
Bring new items into the library: files and downloads, compositions of images, a new scancode, a font's specimen, a linked folder. A new item lands in folder (a rel path from library_find folders, '' the save root), else where the user is looking (state's capture_destination), named by the naming template; name fills its name slot. The result lists the new items (items: id, path); the Activity view's Undo moves them to the Trash.
Needs the Full level, which is the default for any client holding the bearer token.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
action | string one of "import", "compose", "create", "specimen", "link" | yes | What to do. import: Import files as dragging them in does (images, video, audio, fonts, PDFs): each a file in SuperCapture's temp folder (stage it there first), named by its own name in the naming template. Or one url (http/https), downloaded, which the user approves each time; name fills the template's name slot. An item already in the library is copied with library_edit copy. (paths, url, folder, name) compose: Make one new item from images (originals kept): layout row or column joins them into one picture (Join ↔ / ↕), the first as the base and the rest as movable layers; deck makes a slide deck, every page of each in order. (ids, layout, folder, name) create: Make a new item from nothing: kind scancode, a QR code encoding content in the editor's default look (doc_edit then sets its type, fields and style). (kind, content, folder, name) specimen: Save a font's specimen sheet as a new picture (the font explorer's Save). (ids, folder, name) link: Link a folder outside the library: its files become items in place, never moved or changed, watched for changes. The user approves each time. (path) |
paths | string[] | no | import: files in SuperCapture's temp folder. |
url | string | no | import: an http(s) address to download instead. |
ids | string[] | no | compose: the images, in order. specimen: the font. |
layout | string one of "row", "column", "deck" | no | compose: row and column join into one picture, deck makes pages. |
kind | string one of "scancode" | no | create: what to make. |
content | string | no | create: what the scancode encodes (text or a link). |
folder | string | no | Where the new item goes: a rel path, '' the save root (default: the folder open in the gallery). |
name | string | no | The name slot of the new item's file name (import: a url only; a file keeps its own). |
path | string | no | link: the folder's absolute path. |
Example
A JSON-RPC call to POST http://localhost:21516/mcp with the bearer token, filling in the required parameters:
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "library_add", "arguments": { "action": "import" } }}See the MCP server overview for how to connect a client and where the token lives.