Skip to main content
Glama

roam_update_page_markdown

DestructiveIdempotent

Update a Roam page's markdown using smart diff to preserve block references and minimize changes, ideal for syncing external files or AI-assisted content updates.

Instructions

Update an existing page with new markdown content using smart diff. Preserves block UIDs where possible and generates minimal changes. This is ideal for:

  • Syncing external markdown files to Roam

  • AI-assisted content updates that preserve references

  • Batch content modifications without losing block references

⚠️ This REPLACES the page, it does not append. Any block your markdown does not account for is deleted. Pass the complete intended page, or use roam_process_batch_actions / roam_create_outline to change only part of one. Use dry_run: true to see the actions first.

How it works:

  1. Fetches existing page blocks

  2. Matches new content to existing blocks by text similarity

  3. Generates minimal create/update/move/delete operations

  4. Preserves UIDs for matched blocks (keeping references intact)

#.rm-hide / #.rm-private subtrees are excluded from the diff and left untouched — you cannot see them, so you cannot be asked to account for them. preserved_hidden reports how many, when any.

IMPORTANT: call roam_get_guidelines for this graph once per session, and load the Roam Markdown Cheatsheet, before using this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
graphNoTarget graph key from ROAM_GRAPHS config. Defaults to ROAM_DEFAULT_GRAPH. Only needed in multi-graph mode.
titleYesTitle of the page to update
dry_runNoIf true, returns the planned actions without executing them. Useful for previewing changes.
markdownYesNew GFM markdown content for the page
write_keyNoWrite confirmation key. Required for write operations on non-default graphs when write_key is configured.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statsYes
actionsYesRoam batch actions applied (or planned, when dry_run)
successYes
summaryYes
preserved_uidsYesBlocks whose UIDs survived the diff, so refs to them still resolve
preserved_hiddenNoPresent only when non-zero: how many #.rm-hide / #.rm-private blocks were excluded from the diff and left on the page untouched
Behavior5/5

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

Beyond the destructiveHint annotation, the description explicitly discloses that 'This REPLACES the page' and any unaccounted block is deleted. It explains the smart diff algorithm step-by-step, mentions hidden subtrees are excluded and left untouched, and that `preserved_hidden` reports the count. It also notes the requirement to call guidelines once per session, offering deep behavioral insight beyond the structured annotations.

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?

Despite being long, the description is well-structured with clear sections: summary, use cases, warning, how-it-works steps, hidden subtree note, and important prerequisite. Every sentence adds critical information, and the formatting (bullets, bold warning, numbered list) makes it scannable. It is appropriately detailed for a complex, destructive tool.

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?

The description is exceptionally complete given the tool's complexity. It covers purpose, alternatives, destructive behavior, algorithm steps, hidden content handling, output hints, and required prior steps. Combined with rich schema and annotations, the agent has all necessary context to select and invoke the tool safely.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds some context around `dry_run` usage and mentions `preserved_hidden` (an output field), but does not provide additional meaning for the parameters beyond what the schema already documents. It reinforces the purpose but does not elevate semantic understanding.

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 clearly states the tool 'Updates an existing page with new markdown content using smart diff' and lists specific use cases. It distinguishes itself from siblings by explicitly naming alternatives like `roam_process_batch_actions` and `roam_create_outline` for partial edits.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use the tool ('ideal for syncing...', 'AI-assisted content updates...') and when not to, warning that it replaces the whole page and directing to alternatives for partial changes. It also instructs to use `dry_run: true` and to call `roam_get_guidelines` first, covering prerequisites and exclusion conditions.

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

Install Server

Other Tools

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/2b3pro/roam-research-mcp'

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