Skip to main content
Glama

Save Document

dokument_put
Destructive

Ein Dokument anlegen oder ändern (POST bzw. PUT /dokumente).

EIN VERB FUER BEIDE WEGE, weil der Aufrufer selten weiß, ob es das
Dokument schon gibt — dasselbe Muster wie `sache_put`/`bereich_put`.
Gibt es den Slug noch nicht, wird angelegt (dann sind `titel` UND
`inhalt` Pflicht); gibt es ihn, wird geändert, und was du weglässt,
bleibt stehen.

EINORDNEN (Auftrag 8472): `art` = konzept | abnahme | bauplan | text | bericht | sonstiges -- beim Anlegen gesetzt, findet der Filter das Dokument. `bereich` = einer
aus `bereich_list` (entscheidet, welche Persona das Dokument sieht; unbekannt = Fehler). `ordner_id` (aus `dokument_ordner_list`) legt ein NEUES Dokument gleich in einen Ordner; ein
bestehendes verschiebt `dokument_verschieben`, nicht dieses Verb. `art` und `bereich` kannst du auch OHNE neuen Text ändern (dann gibt es keine neue Fassung).
`persona_slug` = als wer du schreibst (dein Name steht dann als Autor in der Liste; ein anderer als dein eigener ist 403, ohne Angabe gilt deine Bindung).

ERWARTETE VERSION (CMP-29): `erwartete_version` = die Version, auf der dein Text aufbaut (aus `dokument_get`). Hat das Dokument inzwischen eine andere, antwortet der Kern mit 409 `version_geaendert` (mit `aktuelle_version`, `geaendert_am` und
`urheber`, wer sie geschrieben hat) und schreibt NICHTS -- lies den aktuellen Stand und uebertrage deine Aenderung darauf. Ohne das Feld gilt es wie bisher (ein zwischenzeitlich gespeicherter Stand wird dann still ueberschrieben).
`notiz` = eine kurze Notiz (hoechstens 300 Zeichen) zur neuen Fassung, steht in `dokument_versionen`; nur beim AENDERN des Titels oder Inhalts. Fuer eine kleine, gezielte Aenderung nimm `dokument_patch`.

WAS BEIM AENDERN PASSIERT, und es ist kein Detail: die alte Fassung wird
ABGELEGT, nicht überschrieben (`dokument_versionen`). Gelöscht wird
nicht — auch kein Text. Die Versionsnummer zählt hoch.

EINE NICHT-AENDERUNG IST EIN FEHLER (409): wer denselben Text noch
einmal schickt, bekommt keine neue Version. Sonst sähe „Version 7" nach
sieben Änderungen aus, die es nicht gab.

Ein BEENDETES Dokument wird nicht mehr geändert (409) — sonst wäre
„beendet" ein Zustand, aus dem man still wieder herauskommt.

BILDER IM TEXT: ein Bild, das du mit `dokument_anhang_put` an DIESES Dokument gehängt hast (PNG, JPEG, WebP), setzt du so in den Text:
`![Unterschrift](anhang:<id>)` -- `<id>` ist die Nummer aus der Anhangsliste (`dokument_anhang_list`). Die Seite zeigt daraus eine Abbildung
(kleine Vorschau, Klick öffnet groß, Unterschrift darunter). Das gilt NUR für ein Bild dieses Dokuments: eine fremde Nummer, ein PDF oder
eine Adresse im Netz (`![x](https://…)`) wird nie zum Bild; die erste Form steht als Text da, die zweite verschwindet. Setz keine Adresse ein.

DU DARFST DAS: ein Agent legt Dokumente selbst an und ändert sie, ohne
Klickfrage. Der Preis ist benannt — ein Dokument ist Text, den ein Mensch
als verbindlich liest. Schreib entsprechend, und verlass dich darauf, dass
der Kern jede deiner Schreibungen mit einer Spur versieht.

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>"
    },
    "name": "dokument_put"
  }
}

Input Schema

NameRequiredDescriptionDefault
artNo
chatNoChat token returned by `persona_waehlen`. With it, the call acts as the persona of that chat; without it, as the unbound connection (Chat-Token aus `persona_waehlen`: mit ihm handelt der Aufruf als die Persona dieses Chats, ohne ihn als die ungebundene Verbindung).
slugYes
notizNo
titelNo
inhaltNo
bereichNo
ordner_idNo
persona_slugNo
erwartete_versionNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only supply readOnlyHint=false and destructiveHint=true; the description adds the real behavioral contract — old revisions are archived rather than overwritten, nothing is deleted, version numbers increment, a no-op write returns 409, a terminated document returns 409, and a foreign persona_slug returns 403. The optimistic-locking behavior including the 409 payload contents (`aktuelle_version`, `geaendert_am`, `urheber`) is disclosed, which is well beyond the annotations. It stops short of describing the success response beyond the existence of an output schema.

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 create-or-update model, then grouped into labeled blocks (EINORDNEN, ERWARTETE VERSION, WAS BEIM ÄNDERN PASSIERT, BILDER IM TEXT), so an agent can skim to the section it needs. The closing "DU DARFST DAS" paragraph is motivational rather than operational, and the image-embedding section is long relative to how rarely it applies — some trimming is possible.

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 10-parameter mutation with 10% schema coverage, the description is unusually complete: conflict semantics, permissions, side effects, and error codes are all present. The main gaps are the german-only phrasing of `chat` (only in the schema) and the absence of any note on what a successful call returns, though an output schema exists and reduces the need.

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 description coverage is only 10%, so the description carries the burden and does: it enumerates the `art` values (konzept/abnahme/bauplan/text/bericht/sonstiges, absent from the schema), defines `bereich` as a persona-visibility key referencing `bereich_list`, explains `ordner_id` only applies to new documents, defines `persona_slug` authorship and the 403 boundary, and explains `erwartete_version` and the 300-character `notiz`. Only `slug` is covered implicitly and `chat` is left to the schema.

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?

"Ein Dokument anlegen oder ändern (POST bzw. PUT /dokumente)" is a specific verb+resource, and it explicitly bounds the tool against siblings: `dokument_patch` for small targeted edits, `dokument_verschieben` for moving existing documents, `dokument_ordner_list`/`bereich_list` for the referenced IDs. The create-or-update duality is stated up front rather than left to inference.

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 rules: use `dokument_patch` for a small targeted change, `dokument_verschieben` to move an existing document, read `dokument_get` and re-apply on a 409. It also states when fields are mandatory (titel+inhalt on create) versus optional on update, and that art/bereich may be changed without new text. That is a full when/when-not/alternative map.

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.