Skip to main content
Glama

Docflare

Edit a document

edit_document
Destructive

Changes what is on a draft's pages: its fields, signatures included, its text and its lines, and whether signers share one copy or each get their own (type). Fields a signer fills need the signers, which prepare_document adds. Each list holds changes: an item without id adds one, an item with id changes only what it sends, and an item with id and delete true removes it. Ids come from get_document (page gives one page's text and lines) and from the added list of earlier answers. Positions are shares of the page width and height, from the top left. Every text on a page, the PDF's own included, can be moved, changed or deleted by its id. New text goes where it is placed, even over other text: the answer's notes name any text that overlaps other text, and the added list gives where each new text ends. A field goes on a line by the line's id, beside text on the page, at page, x and y, or in a free spot at the bottom of the last page. A field that does not sit on a line gets a line drawn under it, except a checkbox, and moving or deleting the field moves or deletes that line. With more than one signer, fields are placed once type is set: on a shared copy each field a signer fills names its signer by email, and when each gets their own copy no field names a signer. A detail Docflare fills in is a variable inside text. These are the only variables: {document.name}, {sender.name}, {sender.email}, {document.sent_date}, and a recipient's full_name, first_name, last_name, email, phone, company, job_title, street_address, city, postal_code, state_region, country, written {recipient1.full_name} with the signer's number from the preview on a shared copy, and {recipient.full_name} when each signer gets their own copy or there is one signer. get_document and every preview list the variables this document can use now, with what each shows (one value per signer, in order, when each gets their own copy); a variable left out has no value yet and would print nothing. Any other {name.name} is refused; the date a signer signs is a date field. On a document the user signs themselves (signed_by_sender), every field is the user's and takes its value now, saved for a signature or initials, which applies the user's saved one; no field names a signer, and the text uses no recipient variables. Variable fields from before become such text, except the reference, completed date and signed date, which stay fields. Nothing is sent. The answer is the same preview, preview_url and review_token as prepare_document gives.

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": {
      "id": "<id>"
    },
    "name": "edit_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe document id.
typeNoWith more than one signer, the user's choice: shared when they all sign one copy (each field a signer fills belongs to one of them), individual when each signer gets their own copy of the same fields and CCs get every copy. Kept for later calls.
linesNoLines to add, change or delete.
textsNoText to add, change or delete.
fieldsNoFields to add, change or delete.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description discloses concrete mutation semantics: delete flags remove items, moving or deleting a field can move or delete its drawn line, prior variable fields become text, and nothing is sent. It also explains signer-dependent placement and saved-signature behavior, giving an agent enough to understand 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.

Conciseness3/5

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

The first sentence is front-loaded and most later sentences carry necessary rules, but the entire definition is delivered as one dense paragraph with long nested clauses. That makes it harder to scan than its complexity warrants, even if little is strictly deletable.

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 complex destructive edit tool with no output schema, the description explains the return shape ('same preview, preview_url and review_token as prepare_document gives'), prerequisites, placement rules, and variable limitations. The coverage is unusually complete for an agent deciding how to invoke it correctly.

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds crucial list semantics—no id adds, id-only changes what it sends, and id plus delete removes—plus id provenance from get_document. It also documents variable syntax and the allowed variable list, which the schema alone does not explain.

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 first sentence states a specific mutating verb ('Changes') and enumerates the resources on a draft: fields, text, lines, and signer copy mode (type). It also names prerequisite siblings get_document and prepare_document, so an agent can tell this is the draft-editing tool rather than a read, prepare, or send tool.

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?

It supplies useful workflow prerequisites: fields need signers added by prepare_document, and ids come from get_document or earlier answers. However, it does not explicitly state when not to use this tool or contrast it with other edit-like siblings, so it stops short of full routing guidance.

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