# MCP tools

The tools the hosted MCP server at https://api.lydie.co/mcp lists. `run_operation` reaches every other operation by id.

## create_doc

Create document. Writes. Scope: `docs:write`.

Create a document. Creates a document in a workspace, optionally under a parent and with an initial Markdown body. Without afterId/beforeId it is appended as the last child.

- `workspaceId` (string, required): (1–64 chars)
- `id` (ULID, optional): Client-minted id. Generated when omitted.
- `parentId` (ULID, optional, nullable): Default: `null`.
- `title` (string, optional): Default: `"Untitled"`. (1–255 chars)
- `properties` (object, optional): Default: `{}`.
- `markdown` (string, optional): Initial body as Lydie Markdown.
- `teamspaceId` (string, optional, nullable): Hosted: the teamspace a top-level page goes into (null or absent: the creator's private section). Ignored for child pages, which share their parent's space, and in local mode. (1–64 chars)
- `afterId` (ULID, optional): Place directly after this sibling.
- `beforeId` (ULID, optional): Place directly before this sibling.
- `sortKey` (string, optional): Explicit fractional key. Overrides afterId/beforeId; recorded by clients so replays converge. (1–256 chars)

## rename_doc

Rename document. Writes. Scope: `docs:write`.

Rename a document.

- `id` (ULID, required)
- `title` (string, required): (1–255 chars)

## move_doc

Move document. Writes. Scope: `docs:write`.

Move a document. Moves a document (and its subtree) under a new parent, or to the top level with parentId null. Without afterId/beforeId it becomes the last child.

- `id` (ULID, required)
- `parentId` (ULID, required, nullable)
- `afterId` (ULID, optional): Place directly after this sibling.
- `beforeId` (ULID, optional): Place directly before this sibling.
- `sortKey` (string, optional): Explicit fractional key. Overrides afterId/beforeId; recorded by clients so replays converge. (1–256 chars)

## delete_doc

Delete document. Destructive. Scope: `docs:write`.

Delete a document. Soft-deletes a document and its subtree. Restore it with doc.restore. Deleting a deleted document is a no-op.

- `id` (ULID, required)

## restore_doc

Restore document. Writes. Scope: `docs:write`.

Restore a deleted document. Restores a soft-deleted document and the part of its subtree deleted with it. If its parent is gone it is restored to the top level.

- `id` (ULID, required)

## purge_doc

Permanently delete document. Destructive. Scope: `docs:write`.

Permanently delete a document. Permanently deletes a document in the trash, its trashed subtree, bodies and outgoing links. Links to it become unresolved. Cannot be undone.

- `id` (ULID, required)

## set_doc_properties

Set document properties. Writes. Scope: `docs:write`.

Set document properties. Merges `set` into the document's properties and removes the keys in `unset`.

- `id` (ULID, required)
- `set` (object, optional): Default: `{}`.
- `unset` (string[], optional): Default: `[]`.

## update_doc

Update document body. Writes. Scope: `docs:write`.

Update a document body. Replaces the body with `markdown`, or applies `edits` (exact old/new string replacements against the Markdown returned by doc.get). Edits that do not match exactly once are skipped and reported in `warnings`. Pass `expectedVersion` to fail with a conflict if the body changed since you read it.

- `id` (ULID, required)
- `markdown` (string, optional)
- `edits` (BodyEditInput[], optional): (≥ 1 items)
  - `oldStr` (string, required): (≥ 1 chars)
  - `newStr` (string, required)
  - `replaceAll` (boolean, optional): Default: `false`.
- `expectedVersion` (string, optional)

## fetch_doc

Fetch document. Read-only. Scope: `docs:read`.

Get a document. Returns a document's metadata and, unless includeBody is false, its Markdown body.

- `id` (ULID, required)
- `includeBody` (boolean, optional): Default: `true`.

## list_docs

List documents. Read-only. Scope: `docs:read`.

List the document tree. Lists documents depth-first in tree order. With rootId, lists that document's descendants only.

- `workspaceId` (string, required): (1–64 chars)
- `rootId` (ULID, optional)
- `includeDeleted` (boolean, optional): Default: `false`.

## list_children

List child documents. Read-only. Scope: `docs:read`.

List a document's children. Lists the direct children of a document (or the top level when parentId is omitted) in order, each with its number of live children. Use it to load a tree level by level.

- `workspaceId` (string, required): (1–64 chars)
- `parentId` (ULID, optional): Omit for the top level.
- `includeDeleted` (boolean, optional): Default: `false`.

## search

Search documents. Read-only. Scope: `docs:read`.

Search documents. Full-text search over titles and bodies. Words are matched as prefixes; all words must match.

- `workspaceId` (string, required): (1–64 chars)
- `query` (string, required): (1–500 chars)
- `limit` (integer, optional): Default: `20`. (1–50)

## list_backlinks

List backlinks. Read-only. Scope: `docs:read`.

List backlinks. Lists live documents that link to this document.

- `id` (ULID, required)

## list_block_backlinks

List block backlinks. Read-only. Scope: `docs:read`.

List backlinks to a block. Lists live documents that link to one block (`[[Note#^blockId]]`) of this document.

- `id` (ULID, required)
- `blockId` (string, required)

## list_outgoing_links

List outgoing links. Read-only. Scope: `docs:read`.

List outgoing links. Lists the links in this document (body first, then properties, in document order), each with the live document it resolves to or null.

- `id` (ULID, required)

## list_unlinked_mentions

List unlinked mentions. Read-only. Scope: `docs:read`.

List unlinked mentions. Lists live documents whose text mentions this document's title without linking to it.

- `id` (ULID, required)
- `limit` (integer, optional): Default: `50`. (1–100)

## list_unresolved_links

List unresolved links. Read-only. Scope: `docs:read`.

List unresolved links. Lists links in live documents whose target does not exist (yet).

- `workspaceId` (string, required): (1–64 chars)

## list_trash

List trash. Read-only. Scope: `docs:read`.

List the trash. Lists what is in a workspace's trash, newest first. A document deleted with its subtree is one item; restoring it restores the subtree.

- `workspaceId` (string, required): (1–64 chars)
- `limit` (integer, optional): Default: `100`. (1–500)

## empty_trash

Empty trash. Destructive. Scope: `docs:write`.

Empty the trash. Permanently deletes everything in a workspace's trash. Cannot be undone.

- `workspaceId` (string, required): (1–64 chars)

## create_attachment

Add attachment. Writes. Scope: `docs:write`.

Add an attachment. Records an attachment whose bytes are already stored under their SHA-256 (the Blob port locally, an upload URL when hosted). Several attachments may share the same bytes.

- `workspaceId` (string, required): (1–64 chars)
- `id` (ULID, optional): Client-minted id. Generated when omitted.
- `documentId` (ULID, optional, nullable): Default: `null`.
- `filename` (string, required): (1–255 chars)
- `contentType` (string, required): (1–255 chars)
- `size` (integer, required)
- `sha256` (string, required)

## delete_attachment

Delete attachment. Destructive. Scope: `docs:write`.

Delete an attachment. Moves an attachment to the trash. Restore it with attachment.restore.

- `id` (ULID, required)

## restore_attachment

Restore attachment. Writes. Scope: `docs:write`.

Restore an attachment.

- `id` (ULID, required)

## purge_attachment

Permanently delete attachment. Destructive. Scope: `docs:write`.

Permanently delete an attachment. Permanently deletes an attachment in the trash. Its bytes are removed when no other attachment uses them. Cannot be undone.

- `id` (ULID, required)

## get_attachment

Get attachment. Read-only. Scope: `docs:read`.

Get an attachment.

- `id` (ULID, required)

## list_attachments

List attachments. Read-only. Scope: `docs:read`.

List attachments. Lists a workspace's attachments, or one document's, newest first.

- `workspaceId` (string, required): (1–64 chars)
- `documentId` (ULID, optional)
- `includeDeleted` (boolean, optional): Default: `false`.

## list_sessions

List agent sessions. Read-only. Scope: `docs:read`.

List agent sessions. Lists sessions that changed a workspace, most recent first.

- `workspaceId` (string, optional): (1–64 chars)
- `limit` (integer, optional): Default: `50`. (1–200)

## list_session_changes

List session changes. Read-only. Scope: `docs:read`.

List a session's changes. Lists every operation a session applied, oldest first.

- `sessionId` (string, required): (≥ 1 chars)
- `limit` (integer, optional): Default: `200`. (1–1000)

## undo_session

Undo session. Writes. Scope: `docs:write`.

Undo a session. Reverts every change a session made, newest first, as one undoable step. Changes that later edits by others touched are skipped and reported, as are changes that cannot be undone.

- `sessionId` (string, required): (≥ 1 chars)

## create_database

Create database. Writes. Scope: `docs:write`.

Create a database. Creates a database: a document whose children are its rows. With documentId, turns an existing document into a database (its children become rows). Starts with a title property and one view.

- `workspaceId` (string, required): (1–64 chars)
- `id` (ULID, optional): Client-minted id of the new database document.
- `documentId` (ULID, optional): Turn this existing document into a database.
- `parentId` (ULID, optional, nullable): Default: `null`.
- `title` (string, optional): Default: `"Untitled database"`. (1–255 chars)
- `teamspaceId` (string, optional, nullable): Hosted: the teamspace a new top-level database goes into (null or absent: the creator's private section). Ignored with parentId or documentId, and in local mode. (1–64 chars)
- `afterId` (ULID, optional): Place directly after this sibling.
- `beforeId` (ULID, optional): Place directly before this sibling.
- `sortKey` (string, optional): Explicit fractional key (recorded so replays converge). (1–256 chars)
- `viewType` (string, optional): One of: `table`, `board`, `list`, `calendar`, `gallery`. Default: `"table"`.
- `titlePropertyId` (ULID, optional)
- `viewId` (ULID, optional)

## get_database

Get database. Read-only. Scope: `docs:read`.

Get a database. Returns a database's settings, live properties and views, in order.

- `id` (ULID, required)

## list_databases

List databases. Read-only. Scope: `docs:read`.

List databases. Lists the live databases of a workspace (database documents not in the trash).

- `workspaceId` (string, required): (1–64 chars)

## query_database

Query database. Read-only. Scope: `docs:read`.

Query a database. Returns one window of a view's rows (filtered, sorted, grouped), with the total and group counts. Pass viewId for a saved view, or view for an ad-hoc one (both: view overrides). uniqueId values are numbers (shown as prefix-number, e.g. LYD-12); filters take 12 or "LYD-12".

- `databaseId` (ULID, required)
- `viewId` (ULID, optional)
- `view` (object, optional)
  - `type` (string, optional): One of: `table`, `board`, `list`, `calendar`, `gallery`. Default: `"table"`.
  - `config` (ViewConfigPatchInput, optional): Default: `{}`.
    - `filter` (FilterNode, optional, nullable)
    - `sorts` (object[], optional)
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
    - `groupBy` (GroupByInput, optional, nullable)
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
      - `order` (string[], optional)
      - `hideEmpty` (boolean, optional): Hide groups with no rows (board columns).
      - `dateBucket` (string, optional): Date grouping; default month. One of: `day`, `week`, `month`, `year`.
      - `collapsed` (string[], optional)
    - `subGroupBy` (GroupByInput, optional, nullable): Board swimlanes.
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
      - `order` (string[], optional)
      - `hideEmpty` (boolean, optional): Hide groups with no rows (board columns).
      - `dateBucket` (string, optional): Date grouping; default month. One of: `day`, `week`, `month`, `year`.
      - `collapsed` (string[], optional)
    - `columns` (ViewColumnInput[], optional)
      - `propertyId` (ULID, required)
      - `visible` (boolean, optional): Default: `true`.
      - `width` (integer, optional): (20–2000)
    - `limit` (integer, optional, nullable): (≥ 1)
    - `summaries` (object, optional): propertyId → summary name
    - `layout` (ViewLayoutInput, optional)
      - `rowHeight` (string, optional): table One of: `short`, `medium`, `tall`, `extra`.
      - `wrapCells` (boolean, optional): table
      - `cardSize` (integer, optional): board, gallery: px (50–1000)
      - `cover` (object, optional, nullable): board, gallery: the card image
      - `coverFit` (string, optional): One of: `cover`, `contain`.
      - `coverAspectRatio` (number, optional): (0.1–10)
      - `markers` (string, optional): list One of: `bullet`, `number`, `none`.
      - `calendarPropertyId` (ULID, optional): calendar: the date property placing rows
      - `calendarMode` (string, optional): One of: `month`, `week`.
      - `showWeekends` (boolean, optional)
      - `colorColumns` (boolean, optional): board
    - `extra` (object, optional)
- `window` (object, optional): Default: `{"offset":0,"limit":100}`.
  - `offset` (integer, optional): Default: `0`.
  - `limit` (integer, optional): Default: `100`. (0–1000)
  - `group` (string, optional, nullable)
  - `subGroup` (string, optional, nullable)
  - `range` (object, optional)
    - `propertyId` (ULID, optional): Default: the view's calendar property.
    - `start` (string, required): Inclusive, YYYY-MM-DD
    - `end` (string, required): Exclusive, YYYY-MM-DD
- `today` (string, optional): The caller's local date for relative date filters. Default: the server's.

## write_database_rows

Write database rows. Destructive. Scope: `docs:write`.

Write database rows. Creates, updates and deletes rows in one step. A row without id is created; with id it is updated (title renames it); delete: true moves it to the trash. values are keyed by property id, frontmatter key or name; relation values are row ids; select values are option names (new names become options); uniqueId values are numbers (pass 12 or "LYD-12"; new rows get the next number). unset clears properties.

- `databaseId` (ULID, required)
- `rows` (object[], required): (1–1000 items)
  - `id` (ULID, optional): An existing row to update or delete.
  - `title` (string, optional): (1–255 chars)
  - `values` (object, optional): Default: `{}`.
  - `unset` (string[], optional): Default: `[]`.
  - `delete` (boolean, optional): Default: `false`.

## change_database_schema

Change database properties. Destructive. Scope: `docs:write`.

Change a database's properties. Adds, changes and removes properties in one step. update can rename (name), change the type (values are converted), the frontmatter key or the config (options, relation, number format, formula expression). Removed properties keep their values in the rows.

- `databaseId` (ULID, required)
- `add` (object[], optional): Default: `[]`.
  - `name` (string, required): (1–200 chars)
  - `type` (string, required): One of: `title`, `text`, `number`, `select`, `multiSelect`, `status`, `date`, `checkbox`, `url`, `email`, `phone`, `person`, `files`, `relation`, `rollup`, `formula`, `uniqueId`, `createdTime`, `updatedTime`, `createdBy`, `updatedBy`.
  - `key` (string, optional): (1–128 chars)
  - `config` (PropertyConfigSpecInput, optional)
    - `options` (object[], optional): select, multiSelect, status
      - `id` (ULID, optional)
      - `name` (string, required): (1–200 chars)
      - `color` (string, optional): One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `red`. Default: `"default"`.
      - `group` (string, optional): One of: `todo`, `inProgress`, `complete`.
    - `numberFormat` (string, optional): One of: `number`, `integer`, `commas`, `percent`, `currency`.
    - `decimals` (integer, optional): (0–10)
    - `currency` (string, optional): ISO 4217 code, with numberFormat currency (3–3 chars)
    - `includeTime` (boolean, optional): date: values carry a time
    - `range` (boolean, optional): date: values may carry an end (start/end)
    - `relation` (RelationConfigInput, optional)
      - `databaseId` (ULID, required): The database whose rows this relation points at.
      - `twoWay` (boolean, optional): Default: `false`.
      - `reversePropertyId` (ULID, optional, nullable): The synced property on the other database (two-way relations). Default: `null`.
      - `limit` (string, optional): One of: `one`, `many`. Default: `"many"`.
    - `rollup` (RollupConfigInput, optional)
      - `relationPropertyId` (ULID, required)
      - `targetPropertyId` (ULID, required): A property of the related database.
      - `function` (string, required): One of: `showOriginal`, `showUnique`, `count`, `countValues`, `countUnique`, `countEmpty`, `countNotEmpty`, `percentEmpty`, `percentNotEmpty`, `sum`, `average`, `median`, `min`, `max`, `range`, `earliest`, `latest`, `checked`, `unchecked`, `percentChecked`, `percentUnchecked`.
    - `expression` (string, optional): formula: an Obsidian Bases expression
    - `prefix` (string, optional): uniqueId: shown before the number ("LYD" → LYD-12) (≤ 16 chars)
    - `extra` (object, optional)
- `update` (object[], optional): Default: `[]`.
  - `property` (string, required): A property's id, frontmatter key or name (case-insensitive). (≥ 1 chars)
  - `name` (string, optional): (1–200 chars)
  - `type` (string, optional): One of: `title`, `text`, `number`, `select`, `multiSelect`, `status`, `date`, `checkbox`, `url`, `email`, `phone`, `person`, `files`, `relation`, `rollup`, `formula`, `uniqueId`, `createdTime`, `updatedTime`, `createdBy`, `updatedBy`.
  - `key` (string, optional): (1–128 chars)
  - `config` (PropertyConfigSpecInput, optional)
    - `options` (object[], optional): select, multiSelect, status
      - `id` (ULID, optional)
      - `name` (string, required): (1–200 chars)
      - `color` (string, optional): One of: `default`, `gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `red`. Default: `"default"`.
      - `group` (string, optional): One of: `todo`, `inProgress`, `complete`.
    - `numberFormat` (string, optional): One of: `number`, `integer`, `commas`, `percent`, `currency`.
    - `decimals` (integer, optional): (0–10)
    - `currency` (string, optional): ISO 4217 code, with numberFormat currency (3–3 chars)
    - `includeTime` (boolean, optional): date: values carry a time
    - `range` (boolean, optional): date: values may carry an end (start/end)
    - `relation` (RelationConfigInput, optional)
      - `databaseId` (ULID, required): The database whose rows this relation points at.
      - `twoWay` (boolean, optional): Default: `false`.
      - `reversePropertyId` (ULID, optional, nullable): The synced property on the other database (two-way relations). Default: `null`.
      - `limit` (string, optional): One of: `one`, `many`. Default: `"many"`.
    - `rollup` (RollupConfigInput, optional)
      - `relationPropertyId` (ULID, required)
      - `targetPropertyId` (ULID, required): A property of the related database.
      - `function` (string, required): One of: `showOriginal`, `showUnique`, `count`, `countValues`, `countUnique`, `countEmpty`, `countNotEmpty`, `percentEmpty`, `percentNotEmpty`, `sum`, `average`, `median`, `min`, `max`, `range`, `earliest`, `latest`, `checked`, `unchecked`, `percentChecked`, `percentUnchecked`.
    - `expression` (string, optional): formula: an Obsidian Bases expression
    - `prefix` (string, optional): uniqueId: shown before the number ("LYD" → LYD-12) (≤ 16 chars)
    - `extra` (object, optional)
- `remove` (string[], optional): Default: `[]`.

## change_database_views

Change database views. Destructive. Scope: `docs:write`.

Change a database's views. Adds, changes and removes views in one step. config is merged into the view's config (filter, sorts, groupBy, columns, …); see get_database for the current values.

- `databaseId` (ULID, required)
- `add` (object[], optional): Default: `[]`.
  - `name` (string, required): (1–200 chars)
  - `type` (string, required): One of: `table`, `board`, `list`, `calendar`, `gallery`.
  - `config` (ViewConfigPatchInput, optional)
    - `filter` (FilterNode, optional, nullable)
    - `sorts` (object[], optional)
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
    - `groupBy` (GroupByInput, optional, nullable)
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
      - `order` (string[], optional)
      - `hideEmpty` (boolean, optional): Hide groups with no rows (board columns).
      - `dateBucket` (string, optional): Date grouping; default month. One of: `day`, `week`, `month`, `year`.
      - `collapsed` (string[], optional)
    - `subGroupBy` (GroupByInput, optional, nullable): Board swimlanes.
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
      - `order` (string[], optional)
      - `hideEmpty` (boolean, optional): Hide groups with no rows (board columns).
      - `dateBucket` (string, optional): Date grouping; default month. One of: `day`, `week`, `month`, `year`.
      - `collapsed` (string[], optional)
    - `columns` (ViewColumnInput[], optional)
      - `propertyId` (ULID, required)
      - `visible` (boolean, optional): Default: `true`.
      - `width` (integer, optional): (20–2000)
    - `limit` (integer, optional, nullable): (≥ 1)
    - `summaries` (object, optional): propertyId → summary name
    - `layout` (ViewLayoutInput, optional)
      - `rowHeight` (string, optional): table One of: `short`, `medium`, `tall`, `extra`.
      - `wrapCells` (boolean, optional): table
      - `cardSize` (integer, optional): board, gallery: px (50–1000)
      - `cover` (object, optional, nullable): board, gallery: the card image
      - `coverFit` (string, optional): One of: `cover`, `contain`.
      - `coverAspectRatio` (number, optional): (0.1–10)
      - `markers` (string, optional): list One of: `bullet`, `number`, `none`.
      - `calendarPropertyId` (ULID, optional): calendar: the date property placing rows
      - `calendarMode` (string, optional): One of: `month`, `week`.
      - `showWeekends` (boolean, optional)
      - `colorColumns` (boolean, optional): board
    - `extra` (object, optional)
- `update` (object[], optional): Default: `[]`.
  - `view` (string, required): A view's id or name (case-insensitive). (≥ 1 chars)
  - `name` (string, optional): (1–200 chars)
  - `type` (string, optional): One of: `table`, `board`, `list`, `calendar`, `gallery`.
  - `config` (ViewConfigPatchInput, optional)
    - `filter` (FilterNode, optional, nullable)
    - `sorts` (object[], optional)
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
    - `groupBy` (GroupByInput, optional, nullable)
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
      - `order` (string[], optional)
      - `hideEmpty` (boolean, optional): Hide groups with no rows (board columns).
      - `dateBucket` (string, optional): Date grouping; default month. One of: `day`, `week`, `month`, `year`.
      - `collapsed` (string[], optional)
    - `subGroupBy` (GroupByInput, optional, nullable): Board swimlanes.
      - `propertyId` (ULID, required)
      - `direction` (string, optional): One of: `asc`, `desc`. Default: `"asc"`.
      - `order` (string[], optional)
      - `hideEmpty` (boolean, optional): Hide groups with no rows (board columns).
      - `dateBucket` (string, optional): Date grouping; default month. One of: `day`, `week`, `month`, `year`.
      - `collapsed` (string[], optional)
    - `columns` (ViewColumnInput[], optional)
      - `propertyId` (ULID, required)
      - `visible` (boolean, optional): Default: `true`.
      - `width` (integer, optional): (20–2000)
    - `limit` (integer, optional, nullable): (≥ 1)
    - `summaries` (object, optional): propertyId → summary name
    - `layout` (ViewLayoutInput, optional)
      - `rowHeight` (string, optional): table One of: `short`, `medium`, `tall`, `extra`.
      - `wrapCells` (boolean, optional): table
      - `cardSize` (integer, optional): board, gallery: px (50–1000)
      - `cover` (object, optional, nullable): board, gallery: the card image
      - `coverFit` (string, optional): One of: `cover`, `contain`.
      - `coverAspectRatio` (number, optional): (0.1–10)
      - `markers` (string, optional): list One of: `bullet`, `number`, `none`.
      - `calendarPropertyId` (ULID, optional): calendar: the date property placing rows
      - `calendarMode` (string, optional): One of: `month`, `week`.
      - `showWeekends` (boolean, optional)
      - `colorColumns` (boolean, optional): board
    - `extra` (object, optional)
- `remove` (string[], optional): Default: `[]`.

## run_operation

Run an operation. Destructive.

Runs any Lydie operation by id with its input, including these not listed as tools: database.update: Update database settings; database.delete: Turn a database back into a page; database.restore: Restore a database; database.setDefinition: Replace a database's schema and views; database.listTemplates: List row templates; database.addProperty: Add a database property; database.renameProperty: Rename a database property; database.updateProperty: Update a database property; database.changePropertyType: Change a property's type; database.moveProperty: Reorder a database property; database.deleteProperty: Delete a database property; database.restoreProperty: Restore a database property; database.addOption: Add a select option; database.updateOption: Rename or recolour a select option; database.moveOption: Reorder a select option; database.deleteOption: Delete a select option; database.createView: Create a database view; database.renameView: Rename a database view; database.duplicateView: Duplicate a database view; database.moveView: Reorder a database view; database.updateView: Update a database view; database.deleteView: Delete a database view; database.restoreView: Restore a database view; database.createRow: Create a database row; database.setValues: Set row values; database.moveRow: Move a database row; database.duplicateRows: Duplicate database rows; database.deleteRows: Delete database rows; database.restoreRows: Restore database rows. Get an operation's input schema with describe_operation.

- `operation` (string, required): Operation id, e.g. doc.move. One of: `doc.create`, `doc.rename`, `doc.move`, `doc.delete`, `doc.restore`, `doc.purge`, `doc.setProperties`, `doc.updateBody`, `doc.get`, `doc.listTree`, `doc.listChildren`, `doc.search`, `doc.backlinks`, `doc.blockBacklinks`, `doc.outgoingLinks`, `doc.unlinkedMentions`, `doc.unresolvedLinks`, `trash.list`, `trash.empty`, `attachment.create`, `attachment.delete`, `attachment.restore`, `attachment.purge`, `attachment.get`, `attachment.list`, `history.listSessions`, `history.listBySession`, `history.undoSession`, `database.create`, `database.update`, `database.delete`, `database.restore`, `database.setDefinition`, `database.get`, `database.listTemplates`, `database.list`, `database.query`, `database.addProperty`, `database.renameProperty`, `database.updateProperty`, `database.changePropertyType`, `database.moveProperty`, `database.deleteProperty`, `database.restoreProperty`, `database.addOption`, `database.updateOption`, `database.moveOption`, `database.deleteOption`, `database.createView`, `database.renameView`, `database.duplicateView`, `database.moveView`, `database.updateView`, `database.deleteView`, `database.restoreView`, `database.createRow`, `database.setValues`, `database.moveRow`, `database.duplicateRows`, `database.deleteRows`, `database.restoreRows`, `database.writeRows`, `database.changeSchema`, `database.changeViews`.
- `input` (object, required): The operation's input.

## describe_operation

Describe an operation. Read-only.

Returns an operation's description and input and output JSON Schemas, for run_operation.

- `operation` (string, required): Operation id, e.g. doc.move. One of: `doc.create`, `doc.rename`, `doc.move`, `doc.delete`, `doc.restore`, `doc.purge`, `doc.setProperties`, `doc.updateBody`, `doc.get`, `doc.listTree`, `doc.listChildren`, `doc.search`, `doc.backlinks`, `doc.blockBacklinks`, `doc.outgoingLinks`, `doc.unlinkedMentions`, `doc.unresolvedLinks`, `trash.list`, `trash.empty`, `attachment.create`, `attachment.delete`, `attachment.restore`, `attachment.purge`, `attachment.get`, `attachment.list`, `history.listSessions`, `history.listBySession`, `history.undoSession`, `database.create`, `database.update`, `database.delete`, `database.restore`, `database.setDefinition`, `database.get`, `database.listTemplates`, `database.list`, `database.query`, `database.addProperty`, `database.renameProperty`, `database.updateProperty`, `database.changePropertyType`, `database.moveProperty`, `database.deleteProperty`, `database.restoreProperty`, `database.addOption`, `database.updateOption`, `database.moveOption`, `database.deleteOption`, `database.createView`, `database.renameView`, `database.duplicateView`, `database.moveView`, `database.updateView`, `database.deleteView`, `database.restoreView`, `database.createRow`, `database.setValues`, `database.moveRow`, `database.duplicateRows`, `database.deleteRows`, `database.restoreRows`, `database.writeRows`, `database.changeSchema`, `database.changeViews`.
