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. Replace existing documents when needed to meet RPS requirements.

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. 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"
      +}
  2. Addedv0.25.3
  3. Removedv0.25.2
  4. First observedv0.18.1

TDQS

A4.5/5.0
Behavior5/5

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

The description discloses key behaviors beyond the annotations: a record holds only one document, an existing document is refused with document_exists unless replace_existing=true which overwrites it, and the RPS business rule. This adds valuable context about side effects and constraints that the annotations (destructiveHint=true) do not fully capture.

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?

The description is two sentences with no fluff. It front-loads the core purpose and then provides essential behavioral details. Every clause earns its place, making it highly efficient for an agent to parse.

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?

For a tool with 5 parameters and no output schema, the description covers the essential behavioral rules, the one-document constraint, the replace_existing option, and the business requirement. An agent has enough information to call the tool correctly in the right situations without needing additional clarification.

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 parameters are already documented. The description reiterates the replace_existing behavior and file types, but does not add significant new meaning beyond the schema. The RPS requirement is business context, not parameter-specific, so the description adds marginal value here.

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 clearly states the action (attach a source document), the resource types (purchase invoice, sale invoice, journal, bank transaction), and the accepted file formats (PDF/JPG/PNG). It distinguishes itself from sibling tools like get_document and delete_document by focusing on the attachment action, making its purpose unambiguous.

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?

The description provides strong contextual guidance: it explains the one-document-per-record rule, the behavior when a document already exists, and the RPS requirement that source documents are mandatory for accounting entries. It does not explicitly state when not to use this tool or name alternatives, but the context is clear enough for an agent to decide when attachment is needed.

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