Create or update a base
save_baseCreates or replaces an Obsidian .base file (a saved query over the pages of a Folio Wiki space), validating the YAML before writing. Provide a path to create or an id to update.
Instructions
Creates a base (an Obsidian .base file, kind "base": a saved query over the pages of a space) or replaces the YAML of an existing one. Give path (e.g. "views/tasks.base", must end in .base, must not exist yet) to create, or id (a base page id) to update; yaml is the whole file: top-level filters, formulas, properties, summaries, views (type table/cards/list, name, filters, order, sort, groupBy, limit). The YAML is checked before anything is written: invalid YAML or a file too large comes back as an error with the line number. Keys this server does not know are kept as written; parts it reads leniently (a filter of an unknown shape) come back in warnings. Use read_page on a base for an example of its YAML, list_properties for the property names (note., file.name, file.mtime, formula.). Returns id, path, etag and a preview of the first view (columns and its first 10 rows, as query_base would answer). One change to one file, committed to Git as the connected user. Requires an editor role and a write-scoped token.
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": {
"space": "<space>",
"yaml": "<yaml>"
},
"name": "save_base"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Update: page id of the base to replace; exactly one of path and id | |
| etag | No | Update only: the etag the file had when you read it (from this tool); a mismatch refuses the write. Without it the write goes through | |
| path | No | Create: path relative to the space root, ending in .base, e.g. "views/tasks.base" (folders are created); exactly one of path and id | |
| yaml | Yes | The whole .base file as YAML text | |
| space | Yes | Space slug |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Page id of the base | |
| etag | Yes | Etag of the file now — pass it as etag on the next update | |
| path | Yes | Path of the .base file relative to the space root | |
| space | Yes | ||
| created | Yes | True when a new base was created, false when an existing one was updated | |
| preview | Yes | The first view answered the way query_base does, at most 10 rows: view, views, columns, rows, total, truncated, warnings, error? | |
| written | Yes | False when the file already held exactly this YAML | |
| warnings | Yes | Parts of the YAML that were read leniently (a view or filter of an unknown shape is ignored by the reader); the file keeps them as written |