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", "video", "audio", "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 (unless they allowed all agent actions this session); name fills the template's name slot. An item already in the library is copied with library_edit copy. A .md or .txt anywhere on disk is copied in by its full path (the user is asked once to let you into its folder) and lands where a new note does. (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) video: Make a video of an audio recording (ids: the one audio item), as the audio editor's Video does: its edited track under a 9:16 background with its transcript as karaoke captions, a new video beside it (the audio is left as it is). Transcribe it first (doc_edit do transcribe) to have captions. It can take a minute or more. (ids) audio: Save a video's sound as an audio item (ids: the one video), a new item beside it (the video is left as it is). Its tracks come apart, each its own lane (a screen recording's mic and system audio), with the video's sound as it is (its clips, speeds, levels, links, a track deleted or a clip unlinked) and transcript, when the edit allows it; when it doesn't yet (a clip of other footage) the edited sound comes as one track and the result says why (tracks_apart false, why_together). (ids) 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 note, a note of content's text (one typed entry; doc_edit adds more). A note never lands in Bookmarks: with no folder it goes where a capture would, else the save root. (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 it, unless they allowed all agent actions this session. (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. video: the audio recording. |
layout | string one of "row", "column", "deck" | no | compose: row and column join into one picture, deck makes pages. |
kind | string one of "scancode", "note" | no | create: what to make. |
content | string | no | create: what the scancode encodes (text or a link), or the note's text. |
folder | string | no | Where the new item goes: a rel path, '' the save root (default: the folder open in the library). |
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.