Skip to main content
Glama
bezata

kObsidian MCP

by bezata

Update Fenced Block

blocks.update
DestructiveIdempotent

Update a fenced block's body in an Obsidian note while keeping fences and language intact, using block ID or index with language guard for safety.

Instructions

Replace one fenced block's body source-preservingly — the surrounding fences, language tag, and neighbouring content are untouched. Locate the block by blockId or index. language acts as a guard: if the located block is not of the declared language, the update fails. source is the replacement body WITHOUT the surrounding ``` fences. Idempotent — re-running with identical inputs is a no-op on the file contents. Destructive — overwrites the previous block body in place.

Operates on the session-active vault (see vault.current — selectable via vault.select) unless an explicit vaultPath argument is passed, which always wins.

Examples:

Example 1 — Replace the first Mermaid diagram in a note:

{
  "filePath": "Diagrams/system-overview.md",
  "language": "mermaid",
  "index": 0,
  "source": "flowchart TD\n  A --> B"
}

Example 2 — Update a DQL query block by stable id:

{
  "filePath": "Dashboards/Inbox.md",
  "language": "dataview",
  "blockId": "inbox-open",
  "source": "TASK\nFROM #inbox\nWHERE !completed"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNo0-based position of the block within its language group in the file. Use when no blockId is available. Defaults to 0 (the first block).
sourceYesReplacement source for the block body, WITHOUT the surrounding ``` fences. Surrounding newlines and indentation are preserved by the tool.
blockIdNoStable block identifier (e.g. `^abc123`). Takes precedence over `index` when both are given.
filePathYesPath of the note containing the block.
languageYesLanguage of the block being updated. Acts as a guard: update fails if the targeted block's real language does not match.
vaultPathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesThe path or identifier the tool acted on.
changedYesTrue if the tool altered vault state on this call; false if it was a no-op.
summaryYesShort human-readable summary of what happened.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.3.5
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Addedv0.1.2

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes well beyond the annotations: it explains the source-preserving behavior, language-mismatch failure, fence exclusion, idempotent no-op effect, in-place destructive overwrite, and vault selection semantics. These details align with the idempotentHint and destructiveHint annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently organized: core behavior and constraints first, then vault targeting, then concrete examples. Every sentence earns its place, and the examples are compact yet informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's six parameters and the existence of an output schema, the description covers all essential calling context: block selection, language guard, source format, vault resolution, idempotency, destructiveness, and failure behavior. An agent has enough information to invoke this tool correctly without additional documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 83%, so the schema already documents most parameters. The description adds value by clarifying that source must exclude fences, that language is a guard, that blockId takes precedence over index, and especially by documenting the vaultPath override semantics that the schema leaves bare. The examples further disambiguate realistic usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: replace one fenced block's body, with explicit scope boundaries (fences, language tag, and neighboring content untouched). This clearly differentiates it from read-oriented siblings like blocks.list/blocks.read and whole-note tools like notes.edit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear operational context: how to locate the block via blockId or index, that language acts as a guard, and that the tool operates on the session-active vault unless vaultPath is supplied. It does not explicitly name alternatives or say when not to use this tool, but the context is strong enough for an agent to apply it correctly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bezata/kObsidian'

If you have feedback or need assistance with the MCP directory API, please join our Discord server