Skip to main content
Glama

Merge Pages

merge_pages
Destructive

Merge one duplicate main-tree Page into another. Read both Pages first and pass both exact revisions. The winner keeps its id and receives the explicitly synthesised body and citations plus the loser's children, pending evidence, and inbound links; the loser is removed.

A lock never refuses a merge — locks fence automatic curation, and you act on a member's instruction — but structure locked on either Page's read means a member deliberately chose that arrangement: say which Page holds the lock and confirm before merging it away.

Pensieve references and citations

Pensieve reads return internal references as ordinary Markdown links such as [display](https://…/r/CONTEXT/data/ID); the trailing number is that node's id — the data_id the citation entries below take. Keep those links exactly when writing Page prose; the server converts trusted links for the target context back to its canonical stored form. Correction links and detached passage links are not storable and are rejected; copy source-image blocks whole. Do not write bare ids or wikilinks. Foreign links stay external; cross-context links are rejected.

For every non-image Data link you add, or whose sentence you write or change, include one or more {"data_id": ID, "quote": "…"} citation entries. Each quote must be a short, exact, contiguous passage copied from that Data read and must directly support the claim. edit_page carries the citations in prose it leaves as it stands; entries for a source replace its stored quotes. Include no citation entry for a Data node the body does not cite. Archived Data cannot ground a current-state claim; cite the replacement the error names. Page identity comes directly from trusted same-context resolver links, so MCP callers do not send Pensieve's internal page_refs sidecar. Source images and their adjacent source links may be copied back as returned; they do not require a quote entry. Omit citations when no quote entries are needed; missing quotes for Data links and unused entries are rejected.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "winner_page_id": "<winner_page_id>",
      "winner_expected_rev": "<winner_expected_rev>",
      "loser_page_id": "<loser_page_id>",
      "loser_expected_rev": "<loser_expected_rev>",
      "merged_body": "<merged_body>",
      "context_id": "<context_id>"
    },
    "name": "merge_pages"
  }
}

Input Schema

NameRequiredDescriptionDefault
citationsNoComplete evidence quote sidecar as {data_id, quote} entries for every non-image Data reference in merged_body; omit when none need quotes. It covers both Pages' surviving prose, and each quote is copied verbatim.
context_idYesThe destination context id from list_contexts. Required for writes.
merged_bodyYesComplete Markdown body for the surviving Page after consolidating both Pages.
loser_page_idYesPositive serial id of the duplicate Page that will be removed.
winner_page_idYesPositive serial id of the canonical Page that will survive.
loser_expected_revYesExact loser revision returned by the latest Page read.
winner_expected_revYesExact winner revision returned by the latest Page read.

Output Schema

NameRequiredDescriptionDefault
revYes
kindYes
titleYes
page_idYes
tree_idYes
warningNo
changeset_idYes
context_run_idYes
removed_page_idYes
affected_page_idsNo
changeset_sequenceYes
collaboration_reloadedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, and the description goes well beyond them: it discloses exactly what survives (id, synthesised body, citations, loser's children, pending evidence, inbound links) and what is destroyed (the loser Page). It also explains the lock semantics that the annotations cannot express, and the citation acceptance/rejection rules for the merged body.

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

Conciseness3/5

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

The opening paragraph is well front-loaded and the lock caveat follows logically, but the citation section sprawls across several dense paragraphs mixing storable-link rules, resolver links, archived Data, source images, and unused-entry rejection. Most of it is useful, but it reads as reference documentation appended to a tool definition rather than tight, prioritised guidance.

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?

For a destructive, multi-parameter consolidation tool, the definition covers the outcomes, revision preconditions, lock handling, and the citation contract that governs a valid `merged_body`. An output schema exists, so the absence of return-value documentation is not a gap.

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 100%, so the baseline is 3, but the description adds real meaning: `*_expected_rev` must come from the latest read of each Page, and the `citations` sidecar must contain one entry per non-image Data link with a short exact contiguous quote, omitted entirely when no quotes are needed. That goes materially beyond the schema's field-level text, though the winner/loser id semantics are already covered by the schema.

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?

"Merge one duplicate main-tree Page into another" names a specific verb and resource plus the qualifying condition (duplicate main-tree Pages). The description then spells out the asymmetric outcome — winner keeps its id, loser is removed — which lets an agent distinguish this from edit_page or delete_page without opening the schema.

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?

Explicit preconditions are given: read both Pages first, pass both exact revisions, and treat `structure locked` as a signal to state which Page holds the lock and confirm before merging it away. It also notes locks never refuse a merge because the caller acts on a member's instruction. What's missing is an explicit statement of when to prefer this over editing one Page or deleting the duplicate outright.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources