Skip to main content
Glama

Create or update a base

save_base
Destructive

Creates 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

NameRequiredDescriptionDefault
idNoUpdate: page id of the base to replace; exactly one of path and id
etagNoUpdate only: the etag the file had when you read it (from this tool); a mismatch refuses the write. Without it the write goes through
pathNoCreate: path relative to the space root, ending in .base, e.g. "views/tasks.base" (folders are created); exactly one of path and id
yamlYesThe whole .base file as YAML text
spaceYesSpace slug

Output Schema

NameRequiredDescriptionDefault
idYesPage id of the base
etagYesEtag of the file now — pass it as etag on the next update
pathYesPath of the .base file relative to the space root
spaceYes
createdYesTrue when a new base was created, false when an existing one was updated
previewYesThe first view answered the way query_base does, at most 10 rows: view, views, columns, rows, total, truncated, warnings, error?
writtenYesFalse when the file already held exactly this YAML
warningsYesParts 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true, but the description adds substantial behavior beyond them: validation happens before any write with line-numbered errors, unknown keys are preserved verbatim, leniently-parsed parts surface in `warnings`, the commit goes to Git as the connected user, and it requires an editor role plus a write-scoped token. The etag refusal behavior and the return payload are also disclosed, which is far more than the annotations carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is one dense paragraph, but front-loaded correctly: what it does, then how to select create vs update, then validation and return semantics. Nearly every clause earns its place, though the returned-preview sentence duplicates what the output schema already carries and could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, multi-mode write tool with auth requirements, this covers everything an agent needs: mode selection, YAML validation timing and failure shape, permission and token scope, Git commit side effect, and return fields. The output schema exists, so the return-value sentence is redundant but harmless rather than a gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: `path` must end in .base and must not exist yet (folders are created), and `yaml` is the whole file with a named structural breakdown (top-level filters, formulas, properties, summaries, views with type/name/filters/order/sort/groupBy/limit). That is more than the schema's one-line 'The whole .base file as YAML text'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The definition opens with a specific verb and resource: 'Creates a base (an Obsidian `.base` file...) or replaces the YAML of an existing one', and defines what a base actually is ('a saved query over the pages of a space'), which separates it from siblings like query_base (read) and update_page (generic page edit). An agent can tell create-vs-update modes apart from the same sentence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit routing rules for the two modes ('Give `path` ... to create, or `id` ... to update') and points to read_page for example YAML and list_properties for property names, which is genuine pre-call guidance. It stops short of an explicit exclusion ('use query_base to read, not this') and does not distinguish itself from update_page for base-page edits, so it is clear but not fully closed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.