Bookmark
media_bookmarkWrite and edit persistent bookmarks, outlines, or chapters in local PDFs, videos, audio, and images, saving PDF outlines in-file plus sidecar VTT/JSON files for later sessions.
Instructions
Write bookmarks (an outline, chapters) into a local media file so they survive across sessions and are visible to humans in the file itself: the PDF outline for a PDF, a sidecar VTT for video/audio, and a sidecar JSON for every supported media type. (写入书签 / 目录 / 章节:PDF 改写文件自带目录;视频、音频写同名 .mmgrep.bookmark.vtt; 所有类型都写 .mmgrep.bookmark.json 侧车。中文触发词:书签、目录、章节、bookmark、outline、chapter。)
The sidecar ".mmgrep.bookmark.json" is the single source of truth. The first write (no sidecar yet) imports the file's own outline — PDF bookmarks, or video/audio chapter markers — as b1…bN in file order, then applies this call. New ids are max+1 and are never reused; update keeps the id. One call can mix add / remove / update; they are applied remove → update → add, all-or-nothing: if anything is invalid, nothing is written and every problem is listed at once (unknown id, bad field, page/time out of range, duplicate ids, malformed entry, …). An image has no native outline and gets the sidecar only; text and Office documents are not supported.
WARNING — this tool modifies files:
A PDF's outline is rewritten IN PLACE: the PDF file itself is modified in place, no copy is made.
Files are written NEXT TO the source: a .mmgrep. sidecar for every media type, plus *.mmgrep.bookmark.vtt for video/audio. They are not written into the cache directory.
When a sidecar already exists, external edits to the file's own outline are OVERWRITTEN on the next write.
Protect your originals with git (or a backup) before calling this tool.
After the write, media_probe / media_overview / media_locate show this outline (ids b1…bN) instead of the file's native one. The result contains the full outline, the sidecar path, the embed target, and every check result. (书签 / 目录 / 章节 / bookmark / outline / chapter)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "media_bookmark"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | Entries to add. Each gets a new id (max+1); do not pass "id". (新增书签:title + page(PDF)或 start/end(视频/音频)) | |
| path | Yes | Absolute path to a LOCAL file: video, audio recording, or document. URLs and relative paths are rejected — this server never downloads anything. (本地文件绝对路径) | |
| remove | No | Bookmark ids to remove, e.g. ["b2"]. Unknown or duplicate ids are errors and nothing is written. (删除书签:b1、b2 …) | |
| update | No | Entries to update: pass "id" plus at least one of title / page / start / end / level. The id never changes. (更新书签:保留 id,只改字段) |