Skip to main content
Glama
OpenLMNP

OpenLMNP

Attach Document

attach_document
Destructive

Attach invoices, receipts, or quotes to expenses, furniture, or work items using base64 content, a server file path, or an HTTP/HTTPS URL.

Instructions

Attache un document justificatif (facture, reçu, devis) à une charge, un mobilier ou un poste de travaux. Trois modes d'entrée mutuellement exclusifs : file_base64 (contenu encodé), file_path (chemin absolu sur le serveur, nécessite MCP_FILE_PATH_PREFIX), file_url (URL http/https téléchargée par le serveur). Le chemin de stockage est : documents/{user_id}/{type}/{filename}.

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": {
      "type": "<type>",
      "record_id": "<record_id>",
      "label": "<label>"
    },
    "name": "attach_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesType d'enregistrement cible : expense, furniture, work
labelYesLibellé du document (ex: Facture plombier, Reçu IKEA)
amountNoMontant indiqué sur le document en euros (optionnel)
file_urlNoURL http/https du fichier à télécharger par le serveur. Mutuellement exclusif avec file_base64 et file_path.
filenameNoNom du fichier avec extension (ex: facture.pdf). Déduit automatiquement depuis file_path ou file_url si absent.
file_pathNoChemin absolu du fichier sur le serveur (nécessite MCP_FILE_PATH_PREFIX configuré). Mutuellement exclusif avec file_base64 et file_url.
record_idYesIdentifiant de la charge, du mobilier ou du poste de travaux
file_base64NoContenu du fichier encodé en base64 (PDF, JPG, PNG, WebP, HEIC — max 10 Mo). Mutuellement exclusif avec file_path et file_url.
document_dateNoDate du document au format Y-m-d (optionnel)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv2.0.1
    • addedInput schema / properties / amount / description
      Added value: +"Montant indiqué sur le document en euros (optionnel)"
    • addedInput schema / properties / document_date / description
      Added value: +"Date du document au format Y-m-d (optionnel)"
    • addedInput schema / properties / file_base64 / description
      Added value: +"Contenu du fichier encodé en base64 (PDF, JPG, PNG, WebP, HEIC — max 10 Mo). Mutuellement exclusif avec file_path et file_url."
    • addedInput schema / properties / file_path / description
      Added value: +"Chemin absolu du fichier sur le serveur (nécessite MCP_FILE_PATH_PREFIX configuré). Mutuellement exclusif avec file_base64 et file_url."
    • addedInput schema / properties / file_url / description
      Added value: +"URL http/https du fichier à télécharger par le serveur. Mutuellement exclusif avec file_base64 et file_path."
    • addedInput schema / properties / filename / description
      Added value: +"Nom du fichier avec extension (ex: facture.pdf). Déduit automatiquement depuis file_path ou file_url si absent."
    • addedInput schema / properties / label / description
      Added value: +"Libellé du document (ex: Facture plombier, Reçu IKEA)"
    • addedInput schema / properties / record_id / description
      Added value: +"Identifiant de la charge, du mobilier ou du poste de travaux"
    • addedInput schema / properties / type / description
      Added value: +"Type d'enregistrement cible : expense, furniture, work"
  2. First observedv0.1.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only carry destructiveHint=true, so the description must add operational context, and it does: the storage path template documents/{user_id}/{type}/{filename} and the server-side download semantics of file_url. It does not explain whether an existing attachment can be overwritten or what is returned, which is a gap given the destructive hint.

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?

Two sentences, front-loaded with purpose followed by the input-mode constraints. Dense but every clause carries information; the storage path template at the end is useful rather than filler.

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

Completeness4/5

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

For a nine-parameter mutation tool with no output schema and only a destructiveHint annotation, the description covers the target record types, the input modes and their exclusivity, and the server-side storage layout. Return values and overwrite behavior remain undocumented but are not essential to calling it correctly.

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 description coverage is 100%, so all nine parameters are already documented, including the mutual exclusivity notes repeated in the description. The description adds only the storage path template, which is marginal value beyond the schema baseline.

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 description states a specific verb and resource (attach a supporting document: invoice, receipt, quote) and names the three target record types (expense, furniture, work). An agent can distinguish this from siblings like analyze_document or export_documents without opening any schema.

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 clearly specifies that the three input modes are mutually exclusive and that file_path requires MCP_FILE_PATH_PREFIX to be configured, plus that file_url is downloaded server-side. It stops short of naming alternative tools or when-not-to-use conditions, so there is no explicit routing to siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.