List Fenced Blocks
blocks.listList fenced code blocks (dataview, dataviewjs, mermaid) in an Obsidian note or across the vault to discover what blocks exist before reading or updating them. Returns filePath, language, index, and id for each block. Read-only.
Instructions
List fenced code blocks of the supported knowledge-base languages (dataview, dataviewjs, mermaid) in a single note or across the vault. Use this to discover what DQL, DataviewJS, or Mermaid blocks exist before reading or updating them. Omit language to list blocks of all three types in one call. Vault-wide scanning is only supported for Mermaid; for Dataview languages a filePath is required. Returns {total, items} where each item carries at minimum {filePath, language, index, id?}. Read-only.
Operates on the session-active vault (see vault.current — selectable via vault.select) unless an explicit vaultPath argument is passed, which always wins.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | No | Scope the listing to a single note. Omit to scan the whole vault (slower; useful for discovery). | |
| language | No | Filter to one language. Omit to list blocks of all supported languages. | |
| vaultPath | No | Override the ambient OBSIDIAN_VAULT_PATH for this call. Rarely needed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | Number of blocks returned. | |
| items | Yes | The listed blocks. | |
| filePath | No | Echoed from the input when a single-file scope was used. |