Skip to main content
Glama

Append to Document

append_to_document

Add text to the end (or the start) of a document you own or can edit without resending the rest of it. The existing content is never touched. Works on Markdown, CSV and Mermaid documents; for JSON, SVG or HTML use edit_document. Pass if_match (a revision such as "r12" from an earlier read) to refuse the write if the document changed since, or on_conflict: "merge" to add to the latest content anyway. Pass an idempotency_key (any string up to 128 characters) so a retry returns the original result instead of adding the text twice. Each change is saved as a new version in the document history. Fails if the document would go over your plan's size limit, and respects the owner's per-document AI permission (read-only or suggestions-only).

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": {
      "slug": "<slug>",
      "content": "<content>"
    },
    "name": "append_to_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
slugYesThe slug of the document to add to
contentYesThe text to add. A line break is inserted between it and the existing text when needed.
if_matchNoRevision (such as "r12") from your last read. If the document has changed since, nothing is written.
positionNoWhere to add it. Default "end".
on_conflictNoWhen if_match is out of date: "fail" (default) writes nothing; "merge" adds to the latest content anyway.
idempotency_keyNoAny string up to 128 characters. A retry with the same key returns the original result instead of writing again.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, and the description usefully adds that existing content is never touched, that each change creates a new revision, that plan size limits apply, and that owner AI permissions (read-only or suggestions-only) can block the write. The `idempotentHint=false` is not contradicted — the description explains idempotency requires an explicit key. It stops short of describing the actual response payload or what a permission-denied failure looks like beyond "fails".

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-loaded with the purpose, then alternates between format routing, concurrency control, idempotency and limits — every sentence carries distinct information. Slightly dense with the idempotency explanation partly duplicating the schema text, but there is no filler.

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

Completeness3/5

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

For a mutation tool with no output schema, the definition covers the important risk surfaces: content preservation, versioning, conflict handling, idempotent retries, size limits and permission gating. What is missing is any indication of what a successful call returns (new revision id?) or the error shape, which matters for a retry/conflict workflow.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all six parameters, including the enums and maxLengths. The description restates the meaning of `if_match`, `on_conflict` and `idempotency_key` in workflow terms (refuse vs merge, retry returns original result), which adds some operational context but little that the schema does not already convey.

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 ("Add text to the end (or the start) of a document") plus the key mechanic (no need to resend existing content). It also names the sibling to use for other formats ("for JSON, SVG or HTML use `edit_document`"), so an agent can route correctly without opening either schema.

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?

Explicitly gives the when-not condition (JSON/SVG/HTML → `edit_document`) and the selection logic between the two conflict strategies: `if_match` to refuse stale writes, or `on_conflict: "merge"` to write to the latest content anyway. Preconditions are also surfaced (owner edit permission, plan size limit).

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.