Skip to main content
Glama

Docfarm

Edit a doc (snippet patch)

patch_doc
Destructive

Edit an existing hosted doc by replacing a snippet of its HTML. DEFAULT TOOL for ANY edit to a doc the user already has — typo, copy change, restyle, new section, anything. ~50 tokens instead of ~7000 for re-hosting. Workflow: (1) if you don't have the current HTML in context, call get_doc_html first to read it. (2) construct before_snippet as a unique chunk of the existing HTML and after_snippet as its replacement. Pass EITHER doc_name (easiest) OR slug. Ambiguous match → fails with context for each candidate. Preserves share link, password, view counts, comments. Patching sends only the changed snippet, so it costs far less than re-sending a whole doc. For several edits at once ("fix the typo AND change the CTA AND update the date") pass a patches array instead of before/after: all of them land atomically or none do, each validated after the previous one applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugNoShare-link slug or full URL. Alternative to doc_name.
accountNoEmail address of the farm to act on. Omit for the signed-in farm. Only a connected account is accepted; call list_accounts to see which.
patchesNoSeveral edits applied atomically. Use this OR before_snippet/after_snippet.
doc_nameNoName of the doc to edit (same name you passed to host_html_content). Use this if you don't have the slug.
after_snippetNoReplacement text. For a single edit.
before_snippetNoExact text to find (must be unique unless occurrence_index given). For a single edit.
occurrence_indexNo0-based index of which match to replace when before_snippet isn't unique

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources