Skip to content

MCP Tools Reference

This page documents all MCP tools available when Claude (or other AI assistants) connects to VMark.

Tool Modes

VMark offers two tool modes to optimize the AI assistant experience:

Writer Mode (Default)

18 tools focused on reading and writing content. Ideal for writing assistance.

Writer mode exposes only the essential tools for content creation:

Understand document:

  • get_document_digest — Document overview, outline, and word counts
  • document_search — Find content in document

Read content:

  • get_section — Read a section by heading (for structured documents)
  • read_paragraph — Read a paragraph by index or content (for flat documents)
  • document_get_content — Full document content (fallback)

Write content:

  • update_section — Modify section content
  • insert_section — Add new sections
  • move_section — Reorder sections
  • write_paragraph — Modify paragraphs (replace, append, prepend, delete)
  • smart_insert — Insert at common locations (end, after paragraph/section)

Control:

  • editor_undo / editor_redo — Fix mistakes

Suggestions:

  • suggestion_list / suggestion_accept / suggestion_reject — Manage suggestions

Files:

  • workspace_save_document — Save changes
  • tabs_switch / tabs_list — Navigate documents

Full Mode

All tools including low-level editor controls. For power users and advanced automation.

Changing Tool Mode

Go to Settings → Integrations → Tool Mode to switch between Writer and Full modes. Changes take effect immediately when AI clients reconnect.


Document Tools

Tools for reading and writing document content.

document_get_content

Get the full document content as markdown text.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier. Defaults to focused window.

Returns: The complete document content in markdown format.

document_set_content

Replace the entire document content.

ParameterTypeRequiredDescription
contentstringYesNew document content (markdown supported).
windowIdstringNoWindow identifier.

Empty Documents Only

For safety, this tool is only allowed when the target document is empty. If the document has existing content, an error is returned.

For non-empty documents, use document_insert_at_cursor or selection_replace instead. These tools create suggestions that require user approval.

document_insert_at_cursor

Insert text at the current cursor position.

ParameterTypeRequiredDescription
textstringYesText to insert (markdown supported).
windowIdstringNoWindow identifier.

Returns: { message, position, suggestionId?, applied }

Markdown Support

The text parameter supports markdown syntax. Content like # Heading, **bold**, - list items, and `code` will be parsed and rendered as rich formatted content.

  • suggestionId - Present when edit is staged (auto-approve disabled). Use with suggestion_accept to apply.
  • applied - true if immediately applied, false if staged as suggestion.

Suggestion System

By default, this tool creates a suggestion that requires user approval. The text appears as ghost text preview. Users can accept (Enter) or reject (Escape) the suggestion. This preserves undo/redo integrity.

If Auto-approve edits is enabled in Settings → Integrations, changes are applied immediately without preview.

document_insert_at_position

Insert text at a specific character position.

ParameterTypeRequiredDescription
textstringYesText to insert (markdown supported).
positionnumberYesCharacter position (0-indexed).
windowIdstringNoWindow identifier.

Returns: { message, position, suggestionId?, applied }

Search for text in the document.

ParameterTypeRequiredDescription
querystringYesText to search for.
caseSensitivebooleanNoCase-sensitive search. Default: false.
windowIdstringNoWindow identifier.

Returns: Array of matches with positions and line numbers.

document_replace

Replace text occurrences in the document.

ParameterTypeRequiredDescription
searchstringYesText to find.
replacestringYesReplacement text (markdown supported).
allbooleanNoReplace all occurrences. Default: false.
windowIdstringNoWindow identifier.

Returns: { count, message, suggestionIds?, applied }

  • count - Number of replacements made.
  • suggestionIds - Array of suggestion IDs when edits are staged (auto-approve disabled).
  • applied - true if immediately applied, false if staged as suggestions.

Selection Tools

Tools for working with text selection and cursor.

selection_get

Get the current text selection.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { text, from, to, isEmpty }

selection_set

Set the selection range.

ParameterTypeRequiredDescription
fromnumberYesStart position (inclusive).
tonumberYesEnd position (exclusive).
windowIdstringNoWindow identifier.

TIP

Use the same value for from and to to position the cursor without selecting text.

selection_replace

Replace selected text with new text.

ParameterTypeRequiredDescription
textstringYesReplacement text (markdown supported).
windowIdstringNoWindow identifier.

Returns: { message, range, originalContent, suggestionId?, applied }

Suggestion System

By default, this tool creates a suggestion that requires user approval. The original text appears with strikethrough, and the new text appears as ghost text. Users can accept (Enter) or reject (Escape) the suggestion.

If Auto-approve edits is enabled in Settings → Integrations, changes are applied immediately without preview.

selection_delete

Delete the selected text.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { message, range, content, suggestionId?, applied }

Suggestion System

By default, this tool creates a suggestion that requires user approval. The text to be deleted appears with strikethrough. Users can accept (Enter) or reject (Escape) the deletion.

If Auto-approve edits is enabled in Settings → Integrations, the deletion is applied immediately without preview.

cursor_get_context

Get text surrounding the cursor for context understanding, including block type information.

ParameterTypeRequiredDescription
linesBeforenumberNoLines before cursor. Default: 3.
linesAfternumberNoLines after cursor. Default: 3.
windowIdstringNoWindow identifier.

Returns: { before, after, currentLine, currentParagraph, block }

The block object contains:

FieldTypeDescription
typestringBlock type: paragraph, heading, codeBlock, blockquote, etc.
levelnumberHeading level 1-6 (only for headings)
languagestringCode language (only for code blocks with language set)
inListstringList type if inside a list: bullet, ordered, or task
inBlockquotebooleantrue if inside a blockquote
inTablebooleantrue if inside a table
positionnumberDocument position where the block starts

cursor_set_position

Set the cursor position.

ParameterTypeRequiredDescription
positionnumberYesCharacter position (0-indexed).
windowIdstringNoWindow identifier.

Formatting Tools

Tools for applying text formatting.

format_toggle

Toggle a formatting mark on the current selection.

ParameterTypeRequiredDescription
markstringYesMark type: bold, italic, code, strike, underline, highlight
windowIdstringNoWindow identifier.

Create a hyperlink on the selected text.

ParameterTypeRequiredDescription
hrefstringYesLink URL.
titlestringNoLink title (tooltip).
windowIdstringNoWindow identifier.

Remove hyperlink from the selection.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

format_clear

Remove all formatting from the selection.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Block Tools

Tools for managing block-level elements.

block_set_type

Convert the current block to a specific type.

ParameterTypeRequiredDescription
typestringYesBlock type: paragraph, heading, codeBlock, blockquote
levelnumberNoHeading level 1-6 (required for heading).
languagestringNoCode language (for codeBlock).
windowIdstringNoWindow identifier.

block_toggle

Toggle block type (converts back to paragraph if same type).

ParameterTypeRequiredDescription
typestringYesBlock type to toggle.
levelnumberNoHeading level (for heading).
windowIdstringNoWindow identifier.

block_insert_horizontal_rule

Insert a horizontal rule (---) at the cursor.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

List Tools

Tools for managing lists.

list_toggle

Toggle list type on the current block.

ParameterTypeRequiredDescription
typestringYesList type: bullet, ordered, task
windowIdstringNoWindow identifier.

list_indent

Increase indentation of the current list item.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

list_outdent

Decrease indentation of the current list item.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Table Tools

Tools for creating and editing tables.

table_insert

Insert a new table at the cursor.

ParameterTypeRequiredDescription
rowsnumberYesNumber of rows (must be at least 1).
colsnumberYesNumber of columns (must be at least 1).
withHeaderRowbooleanNoWhether to include a header row. Default: true.
windowIdstringNoWindow identifier.

table_delete

Delete the table at the cursor position.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

table_add_row

Add a row to the current table.

ParameterTypeRequiredDescription
positionstringYesPosition: before or after current row.
windowIdstringNoWindow identifier.

table_delete_row

Delete the current row.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

table_add_column

Add a column to the current table.

ParameterTypeRequiredDescription
positionstringYesPosition: before or after current column.
windowIdstringNoWindow identifier.

table_delete_column

Delete the current column.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

table_toggle_header_row

Toggle the header row styling.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Editor Tools

Tools for editor state and actions.

editor_undo

Undo the last action.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

editor_redo

Redo the last undone action.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

editor_focus

Focus the editor (bring it to front).

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

VMark Special Tools

VMark-specific features for math, diagrams, and CJK text.

insert_math_inline

Insert inline LaTeX math.

ParameterTypeRequiredDescription
latexstringYesLaTeX expression (e.g., E = mc^2).
windowIdstringNoWindow identifier.

insert_math_block

Insert a block-level math equation.

ParameterTypeRequiredDescription
latexstringYesLaTeX expression.
windowIdstringNoWindow identifier.

insert_mermaid

Insert a Mermaid diagram.

ParameterTypeRequiredDescription
codestringYesMermaid diagram code.
windowIdstringNoWindow identifier.

Example:

graph TD
    A[Start] --> B[Process]
    B --> C[End]

Insert a wiki-style link.

ParameterTypeRequiredDescription
targetstringYesLink target (page name).
displayTextstringNoDisplay text (if different from target).
windowIdstringNoWindow identifier.

Result: [[target]] or [[target|displayText]]

cjk_punctuation_convert

Convert punctuation between half-width and full-width.

ParameterTypeRequiredDescription
directionstringYesto-fullwidth or to-halfwidth.
windowIdstringNoWindow identifier.

cjk_spacing_fix

Add or remove spacing between CJK and Latin characters.

ParameterTypeRequiredDescription
actionstringYesadd or remove.
windowIdstringNoWindow identifier.

Workspace Tools

Tools for managing windows and documents.

workspace_list_windows

List all open VMark windows.

Returns: Array of { label, title, filePath, isFocused, isAiExposed }

workspace_get_focused

Get the focused window's label.

Returns: Window label string.

workspace_focus_window

Focus a specific window.

ParameterTypeRequiredDescription
windowIdstringYesWindow label to focus.

workspace_new_document

Create a new empty document.

ParameterTypeRequiredDescription
titlestringNoOptional document title.

workspace_open_document

Open a document from the filesystem.

ParameterTypeRequiredDescription
pathstringYesFile path to open.

workspace_save_document

Save the current document.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

workspace_save_document_as

Save the document to a new path.

ParameterTypeRequiredDescription
pathstringYesNew file path.
windowIdstringNoWindow identifier.

workspace_get_document_info

Get document metadata.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { filePath, isDirty, title, wordCount, charCount }

workspace_close_window

Close a window.

ParameterTypeRequiredDescription
windowIdstringNoWindow to close. Defaults to focused.

workspace_list_recent_files

List recently opened files.

Returns: Array of { path, name, timestamp } (up to 10 files, most recent first).

Useful for quickly accessing previously edited documents without knowing their full paths.

workspace_get_info

Get information about the current workspace state.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { isWorkspaceMode, rootPath, workspaceName }

  • isWorkspaceMode - true if a folder was opened, false for single-file mode.
  • rootPath - The workspace root directory path (null if not in workspace mode).
  • workspaceName - The folder name (null if not in workspace mode).

Tab Management Tools

Tools for managing tabs within windows.

tabs_list

List all tabs in a window.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: Array of { id, title, filePath, isDirty, isActive }

tabs_get_active

Get the active tab information.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { id, title, filePath, isDirty, isActive }

tabs_switch

Switch to a specific tab.

ParameterTypeRequiredDescription
tabIdstringYesTab ID to switch to.
windowIdstringNoWindow identifier.

tabs_close

Close a tab.

ParameterTypeRequiredDescription
tabIdstringNoTab ID to close. Defaults to active tab.
windowIdstringNoWindow identifier.

tabs_create

Create a new empty tab.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { tabId }

tabs_get_info

Get detailed tab information.

ParameterTypeRequiredDescription
tabIdstringNoTab ID. Defaults to active tab.
windowIdstringNoWindow identifier.

Returns: { id, title, filePath, isDirty, isActive }

tabs_reopen_closed

Reopen the most recently closed tab.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { tabId, filePath, title } or "No closed tabs to reopen" if none available.

VMark keeps track of the last 10 closed tabs per window. Use this to restore accidentally closed tabs.


AI Suggestion Tools

Tools for managing AI-generated content suggestions. When AI uses document_insert_at_cursor, document_insert_at_position, document_replace, selection_replace, or selection_delete, the changes are staged as suggestions that require user approval.

Undo/Redo Safety

Suggestions don't modify the document until accepted. This preserves full undo/redo functionality - users can undo after accepting, and rejecting leaves no trace in history.

Auto-Approve Mode

If Auto-approve edits is enabled in Settings → Integrations, these tools apply changes directly without creating suggestions. The suggestion management tools below are only needed when auto-approve is disabled (the default).

suggestion_list

List all pending suggestions.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { suggestions: [...], count, focusedId }

Each suggestion includes:

  • id - Unique identifier
  • type - insert, replace, or delete
  • from, to - Document positions
  • newContent - Content to be inserted (for insert/replace)
  • originalContent - Content being modified (for replace/delete)

suggestion_accept

Accept a specific suggestion, applying its changes to the document.

ParameterTypeRequiredDescription
suggestionIdstringYesID of the suggestion to accept.
windowIdstringNoWindow identifier.

suggestion_reject

Reject a specific suggestion, discarding it without changes.

ParameterTypeRequiredDescription
suggestionIdstringYesID of the suggestion to reject.
windowIdstringNoWindow identifier.

suggestion_accept_all

Accept all pending suggestions in document order.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

suggestion_reject_all

Reject all pending suggestions.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Protocol Tools

Tools for querying server capabilities and document state.

get_capabilities

Get the MCP server's capabilities and available tools.

Returns: { version, tools[], resources[], features }

get_document_revision

Get the current document revision for optimistic locking.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { revision, hash, timestamp }

Use the revision in mutation tools to detect concurrent edits.


Structure Tools

Tools for analyzing and navigating document structure.

get_document_ast

Get the document's abstract syntax tree.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: Full AST with node types, positions, and content.

get_document_digest

Get a compact digest of the document structure.

ParameterTypeRequiredDescription
windowIdstringNoWindow identifier.

Returns: { sections[], headingCount, paragraphCount, wordCount }

list_blocks

List all blocks in the document with their node IDs.

ParameterTypeRequiredDescription
typestringNoFilter by block type.
windowIdstringNoWindow identifier.

Returns: Array of { nodeId, type, level?, content, position }

Node IDs use prefixes: h-0 (heading), p-0 (paragraph), code-0 (code block), etc.

resolve_targets

Resolve node IDs or queries to document positions.

ParameterTypeRequiredDescription
targetsstring[]YesNode IDs or queries to resolve.
windowIdstringNoWindow identifier.

Returns: Array of { target, found, from?, to?, type? }

get_section

Get content of a document section (heading and its content until next same-or-higher level heading).

ParameterTypeRequiredDescription
nodeIdstringYesNode ID of the heading (e.g., h-0).
windowIdstringNoWindow identifier.

Returns: { nodeId, level, title, content, from, to }


Advanced Mutation Tools

Precision tools for AI agents that need deterministic, position-aware edits.

batch_edit

Apply multiple operations atomically.

ParameterTypeRequiredDescription
operationsarrayYesArray of operations to apply.
baseRevisionstringNoExpected revision for conflict detection.
modestringNoapply, suggest, or dryRun. Default: suggest.
windowIdstringNoWindow identifier.

Each operation requires:

  • type: update, insert, delete, format, or move
  • nodeId: Target node ID (required for update/delete/format/move)
  • after: Node ID to insert after (for insert operations)
  • text/content: New content

Returns: { success, changedNodeIds[], suggestionIds[] }

apply_diff

Find and replace text with match policy control.

ParameterTypeRequiredDescription
originalstringYesText to find.
replacementstringYesText to replace with.
matchPolicystringNofirst, all, nth, or error_if_multiple. Default: first.
nthnumberNoWhich match to replace (0-indexed, for nth policy).
modestringNoapply, suggest, or dryRun. Default: suggest.
windowIdstringNoWindow identifier.

Returns: { matchCount, appliedCount, matches[], suggestionIds[] }

replace_text_anchored

Replace text using context anchoring for precise targeting.

ParameterTypeRequiredDescription
anchorobjectYes{ text, beforeContext, afterContext }
replacementstringYesReplacement text.
modestringNoapply, suggest, or dryRun. Default: suggest.
windowIdstringNoWindow identifier.

The anchor's context fields help disambiguate when the same text appears multiple times.


Section Tools

Tools for manipulating document sections (heading + content).

update_section

Update a section's content.

ParameterTypeRequiredDescription
nodeIdstringYesHeading node ID.
contentstringYesNew section content (markdown).
modestringNoapply, suggest, or dryRun.
windowIdstringNoWindow identifier.

insert_section

Insert a new section.

ParameterTypeRequiredDescription
afterstringYesNode ID to insert after.
levelnumberYesHeading level (1-6).
titlestringYesSection heading text.
contentstringNoSection body content.
modestringNoapply, suggest, or dryRun.
windowIdstringNoWindow identifier.

move_section

Move a section to a new location.

ParameterTypeRequiredDescription
nodeIdstringYesSection to move.
afterstringYesNode ID to move after.
modestringNoapply, suggest, or dryRun.
windowIdstringNoWindow identifier.

Batch Operation Tools

Tools for complex table and list modifications.

table_modify

Batch modify a table's structure and content.

ParameterTypeRequiredDescription
nodeIdstringYesTable node ID.
operationsarrayYesArray of table operations.
windowIdstringNoWindow identifier.

Operations: setCellContent, addRow, deleteRow, addColumn, deleteColumn, setHeaderRow

list_modify

Batch modify a list's structure and content.

ParameterTypeRequiredDescription
nodeIdstringYesList node ID.
operationsarrayYesArray of list operations.
windowIdstringNoWindow identifier.

Operations: setItemContent, addItem, deleteItem, indent, outdent, setChecked


Paragraph Tools

Tools for working with flat documents without headings. Complements Section Tools for structured documents.

read_paragraph

Read a paragraph from the document by index or content match.

ParameterTypeRequiredDescription
targetobjectYesHow to identify the paragraph.
includeContextbooleanNoInclude surrounding paragraphs. Default: false.
windowIdstringNoWindow identifier.

Target options:

  • { index: 0 } — Paragraph by 0-indexed position
  • { containing: "text" } — First paragraph containing the text

Returns: { index, content, wordCount, charCount, position, context? }

write_paragraph

Modify a paragraph in the document.

ParameterTypeRequiredDescription
baseRevisionstringYesDocument revision for conflict detection.
targetobjectYesHow to identify the paragraph.
operationstringYesOperation: replace, append, prepend, delete.
contentstringConditionalNew content (required except for delete).
modestringNoapply or suggest. Default: suggest.
windowIdstringNoWindow identifier.

Returns: { success, message, suggestionId?, applied, newRevision? }

smart_insert

Insert content at common document locations. A unified tool for intuitive insertion scenarios.

ParameterTypeRequiredDescription
baseRevisionstringYesDocument revision for conflict detection.
destinationvariesYesWhere to insert (see options below).
contentstringYesMarkdown content to insert.
modestringNoapply or suggest. Default: suggest.
windowIdstringNoWindow identifier.

Destination options:

  • "end_of_document" — Insert at the end
  • "start_of_document" — Insert at the beginning
  • { after_paragraph: 2 } — Insert after paragraph at index 2
  • { after_paragraph_containing: "conclusion" } — Insert after paragraph containing text
  • { after_section: "Introduction" } — Insert after section heading

Returns: { success, message, suggestionId?, applied, newRevision?, insertedAt? }

When to Use

  • Structured documents (with headings): Use get_section, update_section, insert_section
  • Flat documents (no headings): Use read_paragraph, write_paragraph, smart_insert
  • End of document: Use smart_insert with "end_of_document"

MCP Resources

In addition to tools, VMark exposes these read-only resources:

Resource URIDescription
vmark://document/outlineDocument heading hierarchy
vmark://document/metadataDocument metadata (path, word count, etc.)
vmark://windows/listList of open windows
vmark://windows/focusedCurrently focused window label