Skip to content

MCP Tools Reference

markymark exposes 15 tools through the Model Context Protocol (MCP), giving AI agents and scripts programmatic access to workspace intelligence that complements the real-time LSP features. Agents with both protocols available get the best results by combining them — see Using with AI Agents for workflow examples. Every tool accepts a realm parameter where noted, which defaults to "default" if omitted.

Returns the heading hierarchy for a single document.

ParamRequiredDescription
uriyesDocument URI (file://...)
realmnoRealm to query

Returns all indexed symbols for a document: headings, XML tags, wiki links, and markdown links.

ParamRequiredDescription
uriyesDocument URI
realmnoRealm to query

Fuzzy-match headings, tags, and code references by name across the workspace.

ParamRequiredDescription
queryyesText to match against symbol names
realmnoRealm to query

Rank document sections by relevance to a natural-language query. This tool is feature-gated and may not be available in all builds.

ParamRequiredDefaultDescription
queryyesNatural-language query
realmno"default"Realm to query
top_kno10Max results to return
min_scoreno0.5Minimum relevance threshold

Search documents by free text, frontmatter, Logseq properties, or tags.

ParamRequiredDefaultDescription
querynoFree-text substring search
frontmatter_filter_keynoFrontmatter key to filter on
frontmatter_filter_valuenoFrontmatter value (case-insensitive)
property_filter_keynoLogseq property key
property_filter_valuenoLogseq property value
tag_filternoInclude only documents with this tag
realmno"default"Realm to search
limitno20Max results (0-100)

Regex search across workspace file content with context lines.

ParamRequiredDefaultDescription
patternyesRegex pattern
include_globnoGlob filter (e.g., "*.md")
context_linesno2Lines of context (0-20)
limitno100Max matches (1-500)
case_insensitivenofalseCase-insensitive matching
realmno"default"Realm to search

Find all references to a heading or XML tag at a given position.

ParamRequiredDescription
uriyesDocument URI containing the symbol
lineyes0-based line number
characteryes0-based character offset
realmnoRealm to query

Rename a heading or XML tag and update all references across the workspace.

ParamRequiredDescription
uriyesDocument URI containing the symbol
lineyes0-based line number
characteryes0-based character offset
new_nameyesNew name for the symbol
realmnoRealm to query

Returns diagnostics (broken links, duplicate headings, unclosed XML tags) for a file or all files in a realm.

ParamRequiredDescription
urinoDocument URI (omit to check all files)
realmnoRealm to query

Analyze the link graph of a workspace. Returns orphan documents, hub documents, broken links, and summary statistics.

ParamRequiredDefaultDescription
realmno"default"Realm to analyze
top_n_hubsno10Number of top hub documents
include_clustersnofalseCompute connected clusters

Create a named realm for isolated workspace indexing.

ParamRequiredDescription
nameyesUnique realm name

Delete a realm and unindex all its documents.

ParamRequiredDescription
nameyesRealm to destroy

Add a workspace root directory to a realm, indexing all files within it.

ParamRequiredDescription
realmyesRealm to add the root to
rootyesFilesystem path of the directory

Remove a workspace root from a realm and unindex its documents.

ParamRequiredDescription
realmyesRealm to remove the root from
rootyesFilesystem path of the directory

Get aggregate statistics for a realm: document, heading, tag, and link counts.

ParamRequiredDefaultDescription
realmyesRealm name
check_duplicatesnofalseInclude duplicate document pair count
include_token_countsnofalseInclude aggregate token estimation