Skip to main content
Glama

page_patch

Modify part of an existing page without rewriting it: apply ordered, atomic HTML edits that fail cleanly if a match diverges, so you can update content safely.

Instructions

Change part of an existing Scribe page (open or closed) without rewriting it; does not create pages or change page state. Edits apply in order and atomically: if one fails, nothing changes and the error shows where the stored HTML diverged. Match the body you wrote, not the wrapper Scribe adds around a fragment. For large pages, find the spot with page_grep or a page_read window first. Focuses the tab unless background is true. HTML changes may return a short problems list from the first render; line uses page_read numbering. A timeout omits problems. Details: scribe_docs "Patch an existing page".

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "page_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoTab id, e.g. t_ab12cd34.
keyNoPage key, e.g. scribe:sprint-notes (the scribe: prefix is optional).
editsNoEdits in order, each on the result of the last. Line numbers shift with earlier edits: list line edits bottom to top and pass expectedRevision from the read you numbered them from. Refused on template-bound pages.
titleNoNew tab title; can be sent alone, also for a template-bound page. Ignored for 24h after the user renamed the page (titleKept: true).
replyToNoWhere the page's scribe.reply goes on submit, as in page_show. null clears it.
htmlPathNoLocal HTML file that replaces the whole page (a page_read toFile checkout you edited), keeping title, state and events. Instead of edits.
backgroundNoDon't focus the tab or bring Scribe forward; the change shows as an unread blip.
expectedRevisionNoRefuse the change if the page's revision is no longer this one (from page_read or the last page_patch).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does: it discloses atomic all-or-nothing application, in-order semantics, error reporting that pinpoints divergence in stored HTML, tab-focus behavior gated by background, the optional problems list with timeout caveat, and revision/title side effects.

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 purpose and exclusions, then layers operational caveats; nearly every sentence carries actionable content. It is dense and slightly run-on, with the problems-list and timeout notes packed into one sentence, but nothing is padding.

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

Completeness4/5

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

For an 8-parameter mutation tool with no annotations and no output schema, the description covers atomicity, focus side effects, error shape, and the problems list, which is substantial. It doesn't describe the success response (e.g., new revision), which the agent would need for chaining expectedRevision reads.

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: the warning to match the body you wrote rather than Scribe's fragment wrapper directly affects how oldString must be constructed, and it clarifies that line numbers use page_read/page_grep numbering. Ordering and revision-staleness advice is already in the schema, so no full extra credit.

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?

States a specific verb and resource ("Change part of an existing Scribe page") plus scope ("open or closed") and explicit non-goals ("does not create pages or change page state"), which separates it from page_update/page_open/page_close without needing the schemas.

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?

Gives concrete when-to guidance ("For large pages, find the spot with page_grep or a page_read window first") and rules out other operations. The htmlPath-vs-edits alternative and template-bound refusal are only documented in the schema, so the routing guidance is clear but not fully self-contained.

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