Toggle Edit Mode
workspace.toggleEditModeToggles the active Obsidian note between edit and preview mode. Use after multi-step edits to show the rendered result.
Instructions
Flip the active file in Obsidian between edit (source) mode and preview (reading) mode. Takes no arguments — always toggles whichever mode is currently active. UI-only: does not modify file contents. No-op when no file is active. Returns { ok: true, mode: 'edit' | 'preview' } reflecting the new mode; errors when the Local REST API plugin is unreachable. Useful when an agent has finished a multi-step edit and wants the user to see the rendered result.
Targets the vault the live Obsidian process has open via the Local REST API. Not affected by vault.select — that only changes filesystem-tool routing.
Examples:
Example 1 — Flip the active note from edit to preview (or vice versa).:
{}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||