Skip to main content
Glama
iseppo

e-arveldaja MCP Server

by iseppo

Create Purchase Invoice from PDF

create_purchase_invoice_from_pdf

Create a draft purchase invoice from extracted document data and attach the original file, automating purchase invoice entry from PDFs.

Instructions

Create a draft purchase invoice from extracted document data and attach the source file. Direct-call contract: pass exact invoice vat_price/gross_price when known, never recalculate; non-EUR requires currency_rate (foreign units per 1 EUR, e.g. USD 1.08); base_* may lock actual EUR settlement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesItems [{custom_title, cl_purchase_articles_id, purchase_accounts_id, purchase_accounts_dimensions_id?, total_net_price, vat_rate_dropdown?, amount?, vat_accounts_id?, vat_accounts_dimensions_id?, cl_vat_articles_id?, reversed_vat_id?}]. purchase_accounts_dimensions_id is REQUIRED when the expense account has dimensions; same for vat_accounts_dimensions_id on dimensioned VAT accounts. A VAT-registered company's items carrying VAT need vat_rate_dropdown, else refused before create (purchase_totals_mismatch). Non-VAT EUR invoices may post VAT to the same cost account/dimension with article 11 and one document rate.
notesNoOptional notes (assumptions made, manual adjustments). Do NOT use the source document filename — the document is already uploaded and attached.
currencyNoCurrency code (default EUR). Use the original invoice currency (e.g. USD) and supply currency_rate.
file_nameNoName for the uploaded document (e.g. the original filename for base64 input); defaults to the source file's name. The file's extension is kept.
file_pathYesAbsolute path to the source invoice document (PDF/JPG/PNG); uploaded during creation.
term_daysYesPayment term days
vat_priceNoEXACT total VAT from the original invoice; never recalculate. Omit only if truly absent from the document.
ref_numberNoReference number
gross_priceNoEXACT total gross from the original invoice; never recalculate. Omit only if truly absent from the document.
invoice_dateYesInvoice date (YYYY-MM-DD)
journal_dateYesTurnover/booking date (YYYY-MM-DD)
currency_rateNoExchange rate as foreign currency units per 1 EUR (ECB convention, e.g. USD 1.08; EUR = amount / rate). Required when currency != EUR.
source_sha256YesSHA-256 of the document returned by extract_pdf_invoice; binds this booking to the exact reviewed bytes.
base_net_priceNoEUR equivalent of net_price; auto-derived from currency_rate when omitted.
base_vat_priceNoEUR equivalent of vat_price; auto-derived from currency_rate when omitted.
invoice_numberYesInvoice number
bank_account_noNoSupplier bank account
base_gross_priceNoActual settled EUR gross total; auto-derived from currency_rate when omitted.
block_on_duplicateNoRefuse creation when this receipt's cash outflow looks like an already-booked duplicate (default false: warn only).
supplier_client_idYesSupplier client ID (from resolve_supplier)
require_confirm_planNoRead back the actual uploaded draft and issue a single-use confirmation plan; default false for legacy direct calls.
liability_accounts_idNoLiability account (default 2310)
allow_duplicate_invoice_numberNoExplicit acknowledgement that the supplier reuses this invoice number (e.g. across years): an existing live invoice with the same supplier and number becomes a warning instead of a refusal (default false: refuse).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.32.1
    • changedInput schema / properties / items / description
      Previous value: -"Items [{custom_title, cl_purchase_articles_id, purchase_accounts_id, purchase_accounts_dimensions_id?, total_net_price, vat_rate_dropdown?, amount?, vat_accounts_id?, vat_accounts_dimensions_id?, cl_vat_articles_id?, reversed_vat_id?}]. purchase_accounts_dimensions_id is REQUIRED when the expense account has dimensions; same for vat_accounts_dimensions_id on dimensioned VAT accounts. A VAT-registered company's items carrying VAT need vat_rate_dropdown, else refused before create (purchase_totals_mismatch)."New value: +"Items [{custom_title, cl_purchase_articles_id, purchase_accounts_id, purchase_accounts_dimensions_id?, total_net_price, vat_rate_dropdown?, amount?, vat_accounts_id?, vat_accounts_dimensions_id?, cl_vat_articles_id?, reversed_vat_id?}]. purchase_accounts_dimensions_id is REQUIRED when the expense account has dimensions; same for vat_accounts_dimensions_id on dimensioned VAT accounts. A VAT-registered company's items carrying VAT need vat_rate_dropdown, else refused before create (purchase_totals_mismatch). Non-VAT EUR invoices may post VAT to the same cost account/dimension with article 11 and one document rate."
    • addedInput schema / properties / require_confirm_plan
      Added value: +{
      +  "description": "Read back the actual uploaded draft and issue a single-use confirmation plan; default false for legacy direct calls.",
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changedv0.29.2
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / currency_rate / description
      Previous value: -"Exchange rate as EUR per 1 foreign currency unit. Required when currency != EUR."New value: +"Exchange rate as foreign currency units per 1 EUR (ECB convention, e.g. USD 1.08; EUR = amount / rate). Required when currency != EUR."
    • changedInput schema / properties / items / description
      Previous value: -"Items [{custom_title, cl_purchase_articles_id, purchase_accounts_id, purchase_accounts_dimensions_id?, total_net_price, vat_rate_dropdown?, amount?, vat_accounts_id?, vat_accounts_dimensions_id?, cl_vat_articles_id?, reversed_vat_id?}]. purchase_accounts_dimensions_id is REQUIRED when the expense account has dimensions; same for vat_accounts_dimensions_id on dimensioned VAT accounts."New value: +"Items [{custom_title, cl_purchase_articles_id, purchase_accounts_id, purchase_accounts_dimensions_id?, total_net_price, vat_rate_dropdown?, amount?, vat_accounts_id?, vat_accounts_dimensions_id?, cl_vat_articles_id?, reversed_vat_id?}]. purchase_accounts_dimensions_id is REQUIRED when the expense account has dimensions; same for vat_accounts_dimensions_id on dimensioned VAT accounts. A VAT-registered company's items carrying VAT need vat_rate_dropdown, else refused before create (purchase_totals_mismatch)."
  3. Changed2 schema fields changedv0.27.0
    • addedInput schema / properties / allow_duplicate_invoice_number
      Added value: +{
      +  "description": "Explicit acknowledgement that the supplier reuses this invoice number (e.g. across years): an existing live invoice with the same supplier and number becomes a warning instead of a refusal (default false: refuse).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / file_name
      Added value: +{
      +  "description": "Name for the uploaded document (e.g. the original filename for base64 input); defaults to the source file's name. The file's extension is kept.",
      +  "type": "string"
      +}
  4. Changed3 schema fields changedv0.25.2
    • addedInput schema / properties / block_on_duplicate
      Added value: +{
      +  "description": "Refuse creation when this receipt's cash outflow looks like an already-booked duplicate (default false: warn only).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / source_sha256
      Added value: +{
      +  "description": "SHA-256 of the document returned by extract_pdf_invoice; binds this booking to the exact reviewed bytes.",
      +  "pattern": "^[0-9a-f]{64}$",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "supplier_client_id",
      -  "invoice_number",
      -  "invoice_date",
      -  "journal_date",
      -  "term_days",
      -  "items",
      -  "file_path"
      -]New value: +[
      +  "supplier_client_id",
      +  "invoice_number",
      +  "invoice_date",
      +  "journal_date",
      +  "term_days",
      +  "items",
      +  "file_path",
      +  "source_sha256"
      +]
  5. First observedv0.18.1

TDQS

A3.8/5.0
Behavior4/5

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

With annotations covering the safety profile (readOnly=false, destructive=false), the description adds real behavioral context: it creates a *draft*, it attaches/keeps the source file, and base_* values 'may lock actual EUR settlement'. It also warns against recalculating prices. It omits duplicate-handling behavior (block_on_duplicate / allow_duplicate_invoice_number), which stays in the schema.

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?

Two compact sentences, front-loaded with the action and then the contract rules. No filler, no redundancy with the title.

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 23-parameter mutation tool with no output schema, the description covers the highest-risk items: price exactness, non-EUR rate requirements, and the draft/attachment nature. Remaining gaps (duplicate policy, confirmation-plan flow) are documented in the schema, so the definition is nearly sufficient.

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 the schema already documents all 23 parameters, setting the baseline at 3. The description reinforces the exactness rules for vat_price/gross_price and the currency_rate convention, but these are largely restated from the schema; it adds only marginal meaning, such as base_* locking settlement.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Create a draft purchase invoice') plus the distinguishing behavior ('attach the source file'), and the phrase 'from extracted document data' frames the upstream extraction step. It does not explicitly contrast itself with the sibling create_purchase_invoice, so an agent must infer the difference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Direct-call contract' sentence gives concrete rules for when/how to supply prices and currency_rate, and source_sha256 implies this runs after extract_pdf_invoice. However, it never states when to prefer this tool over create_purchase_invoice or that extraction must precede it, leaving the routing choice implicit.

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