Skip to main content
Glama

Attach File to Document

dokument_anhang_put
Destructive

Eine Originaldatei (xlsx, docx, pdf, csv) oder ein Bild (png, jpeg, webp) an ein Dokument hängen (POST /dokumente/{slug}/anhaenge).

DAS DOKUMENT MUSS ES SCHON GEBEN (`dokument_put` zuerst) -- die Datei ist
der Beleg zu einem Text, nicht ein Ersatz dafür. Der lesbare Inhalt gehört
als Markdown ins Dokument: daraus liest und sucht ein
anderer Agent. Die Originaldatei hängt daneben und bleibt unverändert.

ZWEI WEGE, EINE DATEI ZU NENNEN:
  - `inhalt_base64` + `dateiname`: der Inhalt selbst. Für kleine Dateien.
  - `pfad`: eine Datei im freigegebenen Verzeichnis des MCP-Servers
    (Variable COMPASS_MCP_DATEI_WURZEL). Nur wenn der Betreiber es
    freigegeben hat -- sonst Fehler, kein Raten. Für die Excel-Dateien
    mehrerer Jahre der Weg, der nicht jede Datei durch dein Gespräch
    schickt.

ERLAUBT: xlsx, docx, pdf, csv, höchstens 25 MB, erkannt an den BYTES --
nicht an der Endung. Ältere Formate (xls, doc) und Dateien mit Makros
werden abgewiesen (422).

BILDER (png, jpeg, webp; kein SVG, kein animiertes Bild): höchstens 4 MB und 16 Megapixel. Das Bild wird NEU KODIERT und auf höchstens
2560 Pixel BREITE verkleinert (die Höhe ist frei, ein Ganzseiten-Frame von 1280 x 6000 bleibt lesbar) -- EXIF (auch GPS), Farbprofile und Kommentare sind danach weg, und gespeichert wird nur diese neue
Fassung, nicht dein Original. Prüfsumme und Größe in der Antwort gehören zur gespeicherten Fassung. Zu jedem Bild legt der Kern eine
kleine Vorschau ab (`hat_vorschau`, `breite`, `hoehe` in der Antwort).

DIESELBE DATEI ZWEIMAL am selben Dokument ist kein neuer Anhang (409 mit
dem bestehenden) -- wer 40 Jahresdateien nochmals schickt, bekommt für
die vorhandenen einen Hinweis. Ein BEENDETES Dokument nimmt nichts mehr an.

Der Anhang gehört an die GELTENDE Fassung (`dokument_version`); ändert
sich der Text später, bleibt er bei seiner Fassung.

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_anhang_put"
  }
}

Input Schema

NameRequiredDescriptionDefault
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).
pfadNo
slugYes
dateinameNo
inhalt_base64No

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes far beyond the destructiveHint=true annotation: 25 MB cap with byte-based (not extension-based) type detection, 422 for legacy/macro formats, 4 MB / 16 MP image limits, re-encoding with EXIF/GPS and color profiles stripped and width capped at 2560 px, 409 on duplicate attachments, and closed documents rejecting new attachments. It also clarifies that the attachment binds to the current version rather than tracking later text edits.

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 action and endpoint, then broken into clearly headed blocks (prerequisites, two input paths, allowed types, images, duplicates) that scan well. Some passages, like the aside about sending 40 yearly files twice, are more anecdotal than necessary, and the heavy capitalization is loud but functional.

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?

Although an output schema exists, the description still names the key response fields (hat_vorschau, breite, hoehe, checksum/size of the stored version) so the agent knows what comes back. Combined with the size limits, failure codes and lifecycle rules, nothing an agent needs in order to call this correctly is missing.

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 only 20%, so the description must carry the load, and it does: it defines inhalt_base64, dateiname and pfad semantics, the environment variable gating pfad, and the byte-sniffing validation. The slug and chat parameters are not interpreted in the description, though chat is covered by the schema, leaving a small gap.

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: attaching an original file (xlsx, docx, pdf, csv) or image (png, jpeg, webp) to a document, with the exact endpoint. It also distinguishes itself from dokument_put, which must run first, so an agent can tell the tools apart 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 says the document must already exist and that dokument_put should be called first, and that the readable content belongs in the document as Markdown rather than in the attachment. It also spells out the two mutually exclusive ways to supply a file (inhalt_base64 + dateiname for small files vs. pfad under COMPASS_MCP_DATEI_WURZEL) and which to choose for bulk multi-year Excel files.

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.