Skip to main content
Glama
iseppo

e-arveldaja MCP Server

by iseppo

Attach Source Document

attach_document
Destructive

Attach a PDF, JPG, or PNG source document to a purchase invoice, sale invoice, journal, or bank transaction, with optional replacement if one already exists.

Instructions

Attach a source document (PDF/JPG/PNG) to a purchase invoice, sale invoice, journal, or bank transaction. A record holds one document: an existing one is refused (document_exists) unless replace_existing=true, which overwrites it. RPS requires a source document on every accounting entry; manual journals and directly-booked transactions need one too.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the record to attach the document to.
file_nameNoName for the uploaded document; defaults to the source file's name. The file's extension is kept.
file_pathYesAbsolute path to the source document (PDF/JPG/PNG), or inline content as base64:<data> or base64:<ext>:<data>.
entity_typeYesWhich record the source document belongs to.
replace_existingNoOverwrite a document already attached to the record (the old file is lost). Default false: refuse with document_exists.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.29.2
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed3 schema fields changedv0.27.0
    • addedInput schema / properties / file_name
      Added value: +{
      +  "description": "Name for the uploaded document; defaults to the source file's name. The file's extension is kept.",
      +  "type": "string"
      +}
    • changedInput schema / properties / file_path / description
      Previous value: -"Absolute path to the source document (PDF/JPG/PNG)."New value: +"Absolute path to the source document (PDF/JPG/PNG), or inline content as base64:<data> or base64:<ext>:<data>."
    • addedInput schema / properties / replace_existing
      Added value: +{
      +  "description": "Overwrite a document already attached to the record (the old file is lost). Default false: refuse with document_exists.",
      +  "type": "boolean"
      +}
  3. Addedv0.25.3
  4. Removedv0.25.2
  5. First observedv0.18.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false, and readOnlyHint=false, so safety is partly covered; the description nonetheless adds substantive behavior: an existing document is refused with the document_exists error, and replace_existing=true overwrites and permanently loses the old file. Permission/auth requirements are not mentioned, keeping it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

Three tight sentences: scope first, then the replace/refuse rule, then the domain rationale. No filler, and the most decision-critical constraint (refusal unless replace_existing) is front-loaded.

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?

With no output schema, the description correctly supplies the observable result of failure (document_exists) and success semantics (overwrite wipes the old file). It does not say what a successful attach returns or whether re-attaching the same file is treated as a no-op, but for a single-write tool with full schema coverage that is a minor gap.

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 description coverage is 100%, so the baseline would be 3. The description adds meaning beyond the schema by explaining the 'one document per record' rule and the document_exists failure mode that governs replace_existing, plus the file types accepted for file_path.

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 (attach) and resource (source document) with the exact file formats accepted and enumerates the four target entity types, which are the enum values of entity_type. An agent can immediately distinguish it from get_document and delete_document siblings.

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?

Gives clear use context: the RPS rule that every accounting entry requires a source document, and that manual journals and directly-booked transactions need one too. It also states the one-document-per-record constraint and the replace_existing override. It does not name a sibling (e.g., delete_document to clear a wrong attachment), so it stops short of full when/when-not routing.

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

Deploy Server

Other Tools