Skip to main content
Glama

Edit a Page

edit_page
Destructive

Edit one existing main-tree Page. Read the Page first and pass its exact revision. Optionally supply a non-blank replacement title, and supply either the complete replacement body or exact edits when changing prose. An edit is refused when its text is missing or ambiguous, and otherwise produces exactly the same result as sending the full body. This tool never creates a Page; a blank or omitted title keeps the current title, but an existing titleless Page must receive a non-blank title. Canonical no-op proposals are rejected, so unchanged edits create no history.

Use this when the curated layer itself is wrong or stale and Data supports the fix. For findings, research, a correction only the user attests, or other knowledge the company should keep as evidence, prefer save_data so it is ingested, deduplicated, kept current through curation, and available for Pages to cite.

A lock never refuses an edit — locks fence automatic curation, and you act on a member's instruction — but content locked on the Page's read means a member deliberately chose to keep that exact wording: say so and confirm before rewriting it.

An edited Page's prose stays subject to automatic rewriting from the sources. When a member has dictated wording they want held — not merely asked for a correction — offer to content-lock it with set_lock, and say what that costs: the prose stops absorbing new information.

When a Page you read for another task is wrong and cited Data supports the fix, offer this edit; it is recorded as the user's own change and held against later curation, so make it only with their agreement.

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": {
      "page_id": "<page_id>",
      "expected_rev": "<expected_rev>",
      "context_id": "<context_id>"
    },
    "name": "edit_page"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNoComplete replacement Markdown body. Leave empty to keep the current body; use edits for partial changes.
editsNoExact-span edits applied in order, each {find, replace, replace_all}: find must occur exactly once unless replace_all, and an empty replace deletes it. Leave empty when supplying body.
titleNoOptional replacement title. Blank or omitted keeps the current title; required when the existing Page has no title.
page_idYesPositive serial id of the Page to edit.
citationsNoEvidence quotes as {data_id, quote} entries for the Data links this edit adds or whose sentence it changes; citations in prose left as it stands carry forward with their stored quotes. Entries for a source replace its stored quotes. Omit when none are needed, and for a title-only edit. Each quote is copied verbatim from that Data node.
context_idYesThe destination context id from list_contexts. Required for writes.
expected_revYesExact Page revision returned by the latest Page read.

Output Schema

NameRequiredDescriptionDefault
revYes
urlNoOpens the written Page; for an edit, the History version it produced.
kindYes
titleYes
page_idYes
tree_idYes
warningNo
changeset_idYes
context_run_idYes
affected_page_idsNo
changeset_sequenceYes
collaboration_reloadedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations (readOnly=false, destructive=true, openWorld=false), the description discloses non-obvious behavior: canonical no-op proposals are rejected so unchanged edits create no history, edits are refused when text is missing or ambiguous, locks never block edits but warrant confirmation, and archived Data cannot ground current claims. The citation/link validation rules (correction links rejected, cross-context links rejected, unused entries rejected) add substantial failure-mode detail that annotations cannot convey.

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

Conciseness4/5

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

Front-loads the what/why before the reference-style citation section, which is clearly headed and skimmable. It is long and carries a few redundant restatements (e.g. repeated emphasis that missing quotes or unused entries are rejected), which keeps it from a 5.

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 a destructive mutation with 7 parameters, an output schema, and a citation subsystem, the description covers precondition (read first, exact revision), refusal modes, no-op semantics, staleness handling, and citation constraints. Nothing material needed to call it correctly is missing.

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 baseline is 3; the description earns above baseline by explaining that an edit 'produces exactly the same result as sending the full body,' that blank/omitted title keeps current title but a titleless Page requires one, that each quote must be a verbatim contiguous passage from its Data read, and that citation entries replace stored quotes for a source.

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 opening sentence states a specific verb, resource, and scope: 'Edit one existing main-tree Page,' and immediately adds 'This tool never creates a Page,' which separates it from create_page. It also names save_data as the alternative for knowledge capture, so the agent can distinguish it from siblings without opening schemas.

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?

Explicit routing is given: use this 'when the curated layer itself is wrong or stale and Data supports the fix,' and prefer save_data for findings, research, or user-attested corrections. It further conditions usage on member agreement ('make it only with their agreement') and explains the content-lock offer path via set_lock.

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