Skip to content

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

NameTypeRequiredDescription
actionstring one of "import", "compose", "create", "specimen", "link"yesWhat 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)
pathsstring[]noimport: files in SuperCapture's temp folder.
urlstringnoimport: an http(s) address to download instead.
idsstring[]nocompose: the images, in order. specimen: the font.
layoutstring one of "row", "column", "deck"nocompose: row and column join into one picture, deck makes pages.
kindstring one of "scancode"nocreate: what to make.
contentstringnocreate: what the scancode encodes (text or a link).
folderstringnoWhere the new item goes: a rel path, '' the save root (default: the folder open in the gallery).
namestringnoThe name slot of the new item's file name (import: a url only; a file keeps its own).
pathstringnolink: 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.