MCP tool reference
Corpus speaks the Model Context Protocol over one endpoint, authenticated with a personal access token. Every tool below is read out of the running server's registry, so this page cannot describe a tool the server does not have.
Endpoint
Add this to your MCP client configuration and replace the placeholder with a token from Settings.
{
"mcpServers": {
"corpus": {
"url": "https://corpus.schupke.io/api/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}Tools
33 tools — 11 available to a read token, 22 needing write scope.
list_tree
List vault treereadList the vault as a tree of folders and notes. Omit `path` for the whole vault; pass a folder path to scope the tree to that subtree, and `depth` to limit how far down it goes.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | optional | Folder to scope the tree to. Omit for the whole vault. |
depth | integer1–10 | optional | How many levels below `path` to include. Defaults to the whole subtree. |
list_children
List folder childrenreadList the direct children of one folder (omit `path` for the vault root). Prefer this over list_tree when you only need one level — it never loads note bodies and never walks the whole vault. `depth` above 1 includes deeper descendants.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | optional | Folder whose children are listed. Omit for the vault root. |
depth | integer1–10 | optional | 1 lists direct children only; higher values include deeper descendants. |
limit | integer1–5000 | optional | Maximum entries to return. The response sets `truncated` when the cap was reached. |
stat
Inspect a pathreadReport whether a vault path is a note or a folder, with its id and canonical stored path. Use it instead of guessing a kind — note paths are stored without the `.md` extension. A note also reports a `docKind`: `canvas` means it holds a drawing, which the editing tools refuse to write text into.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault path to inspect. Note paths are stored without the `.md` extension. |
get_document
Read a notereadRead a note by vault-relative path. Returns id, path, kind, markdown content, and timestamps. A note whose kind is `canvas` holds a drawing rather than text, and its content is always empty.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the note to read. |
get_document_by_id
Read a note by idreadRead a note by stable document UUID. Returns path, kind, markdown content, and timestamps. A note whose kind is `canvas` holds a drawing rather than text, and its content is always empty.
| Name | Type | Required | Description |
|---|---|---|---|
documentId | uuid | required | Stable document UUID, as returned by `stat` or any listing. |
search
Search notesreadSearch the vault. Note hits come back in `hits`, carrying the note path and a 1-based line number, or line 0 when the query matched the note's name rather than its body. Folder hits come back separately in `folders`, and only when `kinds` asks for them. `matchPath` widens matching to the full vault path, so a query of 'projects' also finds notes inside a folder of that name.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | required | Text to look for in note names and note bodies. May be empty only when `tags` is given. |
limit | integer1–200 | optional | Maximum hits to return. |
kinds | "file" | "dir"[]1–∞ items | optional | Which kinds to search. Folder hits come back only when 'dir' is included. |
matchPath | boolean | optional | Also match the full vault path, so a query finds notes inside a folder of that name. |
tags | string[]1–∞ items | optional | Restrict to entries carrying ALL of these tags, matched ignoring case. With tags set, `query` may be empty, which lists everything carrying them. |
list_document_versions
List note versionsreadList saved version metadata for a note by vault-relative path.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the note whose versions are listed. |
get_document_version
Read a note versionreadRead the archived markdown content for a saved note version by version UUID.
| Name | Type | Required | Description |
|---|---|---|---|
versionId | uuid | required | Version UUID, as returned by `list_document_versions`. |
restore_document_version
Restore a note versionwriteRestore a saved note version by version UUID. The restored content becomes current and archives the previous current content.
| Name | Type | Required | Description |
|---|---|---|---|
versionId | uuid | required | Version UUID to restore, as returned by `list_document_versions`. |
create_document
Create a notewriteCreate a markdown note at the given vault-relative path, optionally with initial content. Missing parent folders are created. Fails when the path is taken unless `ifExists` is 'skip'.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path for the new note, without the `.md` extension. |
content | string | optional | Initial markdown body. The note starts empty when omitted. |
ifExists | "error" | "skip" | optional | 'error' (the default) fails when the path is taken; 'skip' leaves the existing entry alone. |
update_document
Overwrite a notewriteOverwrite the markdown body of a note, creating it (and any missing parent folders) when it does not exist. A previous version is archived only when the content actually changed.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the note to overwrite. Created when it does not exist. |
content | string | required | The complete new markdown body. It replaces the note entirely. |
append_document
Append to a notewriteAppend text to the end of an existing note, atomically. Prefer this over reading a note and writing it back: a concurrent edit cannot be lost. By default a newline is inserted first when the note does not already end with one. Empty text is a no-op and does not archive a version.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the note to append to. |
text | string | required | Markdown added at the end of the note. Empty text is a no-op. |
ensureLeadingNewline | boolean | optional | Insert a newline first when the note does not already end with one. Defaults to true. |
replace_in_document
Substitute text in a notewriteFind and replace inside one note, server-side. `mode` 'literal' treats `find` as plain text; 'regex' matches each line separately, so `^` and `$` anchor per line and a pattern cannot span a newline. `dryRun` reports what would change without writing. A run that changes nothing leaves the note, and its modified time, untouched.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the note to edit. |
find | stringmax 1000 chars | required | The text or regular expression to search for, per `mode`. |
replace | string | required | What each match becomes. Empty string deletes the match. |
mode | "literal" | "regex" | optional | 'literal' (the default) treats `find` as plain text; 'regex' matches line by line. |
ignoreCase | boolean | optional | Match without regard to case. Defaults to false. |
all | boolean | optional | Replace every match rather than only the first. Defaults to false. |
maxReplacements | integer1–9007199254740991 | optional | Stop after this many replacements. |
dryRun | boolean | optional | Report what would change without writing anything. |
delete_document
Delete a notewritedestructiveDelete a note at the given vault path.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the note to delete. |
create_spreadsheet
Create a spreadsheetwriteCreate a spreadsheet at the given vault-relative path, optionally with initial cells. Missing parent folders are created. Fails when the path is taken unless `ifExists` is 'skip'.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path for the new spreadsheet. |
cells | object[] | optional | Initial cells. The sheet starts empty when omitted. |
ifExists | "error" | "skip" | optional | 'error' (the default) fails when the path is taken; 'skip' leaves the existing entry alone. |
get_spreadsheet
Read a spreadsheetreadRead a spreadsheet. Returns `tsv`, a tab-separated rendering with one line per row, and `cells`, the raw text of every filled cell keyed by A1 reference. Formulas are returned as written, not as their results.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the spreadsheet to read. |
set_cells
Write cells in a spreadsheetwriteWrite individual cells, leaving every other cell as it is. Send an empty string to clear a cell. The sheet grows to cover any cell written past its current extent. Formatting already on a cell is kept.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the spreadsheet. |
cells | object[] | required | Cells to write. Anything not listed is left as it is. |
snapshot | boolean | optional | Archive the sheet as it was before this write, so the change can be reverted. |
replace_spreadsheet
Replace a spreadsheet's cellswritedestructiveReplace every cell in a spreadsheet with the given set, discarding anything not listed. Use `set_cells` to change part of a sheet; this is for rewriting one wholesale. Cell formatting is discarded with the old cells.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault-relative path of the spreadsheet. |
cells | object[] | required | The complete new set of cells. Anything omitted is cleared. |
snapshot | boolean | optional | Archive the sheet as it was before this write, so the change can be reverted. |
create_folder
Create a folderwriteCreate a folder at the given vault path, creating any missing parents. Fails when the path is taken unless `ifExists` is 'skip'.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault path for the new folder. Missing parents are created. |
ifExists | "error" | "skip" | optional | 'error' (the default) fails when the path is taken; 'skip' leaves the existing folder alone. |
move_entry
Move or renamewriteMove a note or folder to an explicit destination path — re-parent, rename, or both in one call. When `to` names an existing folder the entry moves into it keeping its own name (as `mv` does). Missing parent folders are created. `kind` is inferred unless given.
| Name | Type | Required | Description |
|---|---|---|---|
from | string | required | Current vault path of the note or folder to move. |
to | string | required | Destination path. Naming an existing folder moves the entry into it under its own name. |
kind | "file" | "dir" | optional | Whether the path is a note ('file') or a folder ('dir'). Inferred when omitted. |
rename
Rename in placewriteRename a note or folder, keeping its parent. `kind` is inferred when omitted. Prefer move_entry, which can rename and re-parent in one call.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault path of the note or folder to rename. |
newName | string | required | The new name, without any slashes. The parent is unchanged. |
kind | "file" | "dir" | optional | Whether the path is a note ('file') or a folder ('dir'). Inferred when omitted. |
move
Move under a parentwriteMove a note or folder under a new parent folder, keeping its name. Omit `toParent` for the vault root. Prefer move_entry, which takes a full destination path.
| Name | Type | Required | Description |
|---|---|---|---|
from | string | required | Current vault path of the note or folder to move. |
toParent | string | optional | Folder to move it under, keeping its name. Omit for the vault root. |
delete_path
Delete a note or folderwritedestructiveDelete a note or folder at the given vault path, with everything under it. `kind` is inferred when omitted; a path claimed by both a note and a folder is refused rather than guessed. `recursive` defaults to true; pass false to refuse a folder instead, which lets a client enforce an `rm -r` style guard without a separate lookup.
| Name | Type | Required | Description |
|---|---|---|---|
path | string | required | Vault path of the note or folder to delete. |
kind | "file" | "dir" | optional | Whether the path is a note ('file') or a folder ('dir'). Inferred when omitted. |
recursive | boolean | optional | Defaults to true. Pass false to refuse the call when the path is a folder. |
create_tag
Create a tagwriteCreate a tag in the library without attaching it to anything. Only needed to pick a colour up front — set_tags and add_tags create missing tags on their own. Fails when the name is taken, ignoring case.
| Name | Type | Required | Description |
|---|---|---|---|
name | stringmax 64 chars | required | Tag name. Stored with this casing; matched ignoring case. |
color | string | null | optional | Hex colour, '#rgb' or '#rrggbb'. Omit or pass null for no colour. |
update_tag
Rename or recolour a tagwriteRename a tag, change its colour, or both. Renaming keeps every assignment. Pass color: null to clear the colour; omit the field to leave it alone.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | required | Tag id, from list_tags. |
name | stringmax 64 chars | optional | New name. Omit to keep the current one. |
color | string | null | optional | New hex colour, or null to clear it. Omit to leave the colour unchanged. |
delete_tag
Delete a tagwritedestructiveRemove a tag from the library. Allowed while it is in use: every note and folder carrying it loses it. This is the only thing that removes a tag — nothing prunes unused ones.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | required | Tag id, from list_tags. |
bulk_move
Move many entries at oncewriteMove or rename up to 100 notes and folders in a single transaction — either all of them move or none do. Each entry gives its own destination, so one call can re-parent some entries and rename others. When a `to` names an existing folder the entry moves into it keeping its own name. Prefer this over repeating move_entry: it is atomic, and it counts as one request against the rate limit.
| Name | Type | Required | Description |
|---|---|---|---|
entries | object[]1–100 items | required | The moves to apply, up to 100. All of them succeed or none do. |
bulk_delete
Delete many entries at oncewritedestructiveDelete up to 100 notes and folders in a single transaction — either all of them go or none do. A folder takes everything under it. Naming both a folder and something inside it is fine: the inner path is covered by the folder and is not reported separately. A path claimed by both a note and a folder is refused rather than guessed. `recursive` defaults to true and applies to the whole batch; pass false to refuse the batch if any entry is a folder.
| Name | Type | Required | Description |
|---|---|---|---|
paths | string[]1–100 items | required | Vault paths to delete, up to 100. All of them go or none do. |
recursive | boolean | optional | Defaults to true, and applies to the whole batch. False refuses a batch containing a folder. |