library_edit
LibraryFull
Change items and folders in the library as its menus do. Items are ids (from any result; a path or name works too); every one must resolve before anything changes. Each change is undoable from the Activity view. What a document holds is doc_edit's; deleting for good is library_delete's.
Needs the Full level, which is the default for any client holding the bearer token.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
action | string one of "rename", "move", "copy", "duplicate", "tag", "untag", "set_tags", "trash", "restore", "mark_read", "mark_unread", "inbox", "uninbox", "remove_duplicates", "add_to_note", "make_note", "make_bookmark", "merge_into_note", "create_folder", "rename_folder", "move_folder", "delete_folder" | yes | What to do. rename: Rename one item (its file, kept beside it; name is the new name without extension). The id doesn't change. (ids, name) move: Move items into a folder: '' the save root (Inbox), 'Bookmarks' the bookmarks folder, else a folder's rel path from library_find folders. (ids, folder) copy: Copy items into a folder as new, independent items (Copy to Folder), a recording with its edits. (ids, folder) duplicate: A copy of each item beside it in the library, to change while keeping the original (Duplicate); a video or audio recording is copied with its edits. (ids) tag: Add tags to items. (ids, tags) untag: Remove tags from items. (ids, tags) set_tags: Replace items' tags ([] removes them all). (ids, tags) trash: Move items to the Trash (library_find trash lists it; restore takes them back). (ids) restore: Take items back out of the Trash. (ids) mark_read: Mark bookmarks read. (ids) mark_unread: Mark bookmarks unread. (ids) inbox: Add items to the Inbox where they are filed, without moving them (Add to Inbox): the triage pile shows them until they're dismissed. (ids) uninbox: Take items off the Inbox without filing them (Remove from Inbox); they stay where they are. (ids) remove_duplicates: Keep one item of each duplicate group (library_find duplicates), the newest or the oldest, and move the rest to the Trash. With query, only the groups that search finds. (keep, query) add_to_note: Add items to a note as the Add to Note menu does: an entry pointing at each (a bookmark as its page's link card, anything else, another note included, as a reference to it), text going with the first. note is the note's id; leave it out to make a new note of them. The result names the note and the entries added (doc_read shows them). (ids, note, text) make_note: Make bookmarks notes (Make into Note): each bookmark note's type: bookmark line goes and nothing else does; its url, entries, file and id stay. (ids) make_bookmark: Make notes bookmarks (Make into Bookmark): a note with a url in its header, or a link alone on its first line, gets type: bookmark. (ids) merge_into_note: Merge a bookmark note into a note (Merge into Note): its entries and pictures are added to note (its id), the captured page under a link to it, and the bookmark goes to the Trash. (ids, note) create_folder: Make a folder: parent '' (default) the save root, 'Bookmarks' a reading folder, else a folder's rel path. An existing folder there is returned. (name, parent) rename_folder: Rename a folder (its rel path from library_find folders). (folder, name) move_folder: Move a folder under another (parent: a rel path, '' for the top level). (folder, parent) delete_folder: Delete a folder: everything in it goes to the Trash. (folder) |
ids | string[] | no | The items: ids, or paths. |
name | string | no | rename: the item's new name, without extension. create_folder / rename_folder: the folder's name. |
folder | string | no | move / copy: where to (a rel path, '' the save root, 'Bookmarks' the bookmarks folder). rename_folder / move_folder / delete_folder: which folder (its rel path). |
parent | string | no | create_folder / move_folder: the folder it goes in (a rel path, '' the top level). |
tags | string[] | no | tag / untag / set_tags: the tags. |
keep | string one of "newest", "oldest" | no | remove_duplicates: which of each group stays. |
query | string | no | remove_duplicates: only the groups this search finds. |
note | string | no | add_to_note: the note to add to (its id); left out, a new note. |
text | string | no | add_to_note: a line about the items, written with the first entry. |
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_edit", "arguments": { "action": "rename" } }}See the MCP server overview for how to connect a client and where the token lives.