Skip to main content
Glama

peppol.sh

Send a document

send_document
DestructiveIdempotent

Sends an invoice or a credit note over Peppol from JSON (POST /v1/documents). Call validate_document first. idempotency_key is required: a retry with the same key does not send twice. With a ps_test_ key (sandbox) it sends at once and costs no credit. With a ps_live_ key it sends a real document and uses 1 credit, in two calls: the first call returns a preview and a confirmation_handle and sends nothing; show the preview to the user, and only after the user approves, call again with the same arguments plus confirm: true and the confirmation_handle (valid 10 minutes). Live sends work only when the workspace setting "Allow live sends from MCP" is on. The tool is marked destructive for Live; the mark cannot change with the key, so a host can ask the user to approve a sandbox send too.

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": {
      "number": "<number>",
      "issue_date": "<issue_date>",
      "from": "<from>",
      "to": "<to>",
      "lines": "<lines>",
      "idempotency_key": "<idempotency_key>",
      "company_id": "<company_id>"
    },
    "name": "send_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYes
fromYesA sender or recipient party on a document. A party needs a `tax_id`, a `peppol_id`, or both.
noteNoOptional note to include on the document
typeNo
linesYes
vatexNoVAT exemption reason code (BT-121) from the VATEX code list, e.g. `VATEX-EU-132`. Applies at document level only.
numberYesYour document number (e.g., "INV-2026-001")
chargesNoDocument-level charges (BG-21) — additions applied before tax.
confirmNoLive only. Leave out on the first call: it returns a preview and a confirmation_handle, and sends nothing. Set to true on the second call, after the user approved the preview.
currencyNo
due_dateNo
tax_codeNoDocument VAT category code (BT-118), e.g. `S` (standard), `Z` (zero), `E` (exempt), `AE` (reverse charge). Defaults to `S`, or `Z` when every line is zero-rated.
allowancesNoDocument-level allowances (BG-20) — deductions applied before tax.
amount_dueNoAmount due for payment (BT-115), in the document currency. Use it for a document that is paid, fully or in part, before you send it: `0` for a fully prepaid document. Allowed on both `invoice` and `credit_note`. The value must be from `0` up to the document total with VAT (BT-112) plus `rounding_amount`, with at most two decimals. A value above that is refused with a 422 `amount_due_exceeds_total`. The prepaid amount (BT-113, `cbc:PrepaidAmount`) is not an input: it is the total with VAT plus `rounding_amount` less `amount_due`. If you omit the field, the amount due is the total with VAT plus `rounding_amount`, and the document has no prepaid amount.
company_idYesThe company that sends, for example com_9fJ2kQ7bTx0Lm4Ne1Ry8.
issue_dateYes
vatex_noteNoVAT exemption reason text (BT-120). Applies at document level only.
attachmentsNo
sales_orderNoSales order reference (BT-14), `cac:OrderReference/cbc:SalesOrderID`: the seller's own order number. Without `purchase_order`, the `cbc:ID` of the order reference is `NA`.
payment_meansNoHow the document should be paid: one method, one reference, and one or more accounts. Use `accounts` for a bankgiro or plusgiro number or for more than one account. `iban` and `bic` are the older form of one `iban` account: they give a 400 together with `accounts`. An account number is required (BR-61, Payment account identifier BT-84): `iban` or `accounts`, for every `method`. When both are absent and `from` is the company of `company_id`, the `iban` of the company fills `iban` when, with spaces and dashes removed, it is a valid IBAN (15 to 34 characters, two letters, and the IBAN check digits). The compact value is stored. A `bic`, `method` and `reference` you send are kept, so `GET /v1/documents/{id}` and the UBL show it. With no account number after that, the document is rejected with `payment_account_required` (422, `param` `payment_means`) before any charge. A document without `payment_means` is not checked. Required by Peppol when seller and buyer are both in Germany (DE-R-001): without `payment_means` the document is rejected with `de_domestic_fields_missing` (422).
invoice_periodNoInvoicing period (BG-14) — the service or billing date range.
purchase_orderNoPurchase order reference (BT-13), `cac:OrderReference/cbc:ID`: the number of the buyer's purchase order.
buyer_referenceNoBuyer reference (BT-10), `cbc:BuyerReference`: the reference the buyer asks for, for example a cost centre or a Leitweg-ID. It is not copied to `cac:OrderReference/cbc:ID` (BT-13): send a purchase order in `purchase_order`. Without `buyer_reference`, a document gets `purchase_order`, else `to.identifier`, else `Unknown` as BT-10. Required in two cases. When seller and buyer are both in Germany (DE-R-015): without it the document is rejected with `de_domestic_fields_missing` (422). When the receiver is a German public body (a `0204` Peppol ID): it holds the Leitweg-ID, and without it the document is rejected with `buyer_reference_required` (422).
idempotency_keyYesRequired. A unique key for this document, for example its number. A retry with the same key returns the first document and does not send again.
rounding_amountNoRounding amount (BT-114, `cbc:PayableRoundingAmount`), in the document currency: the signed amount that rounds the amount due, for example to whole kronor. Allowed on both `invoice` and `credit_note`, for any seller country and currency. The amount due (BT-115) is the total with VAT (BT-112) less the prepaid amount (BT-113) plus `rounding_amount`. `total` does not include it. With an `amount_due`, send the rounded amount: an `amount_due` equal to the total, with a rounding that is not `0`, is refused with a 422 `amount_due_excludes_rounding` when the rounding is positive, and with a 422 `amount_due_exceeds_total` when it is negative. The value has at most two decimals and must be below `1.00` either way. A value of `1.00` or more, or one that takes the total below `0`, is refused with a 422 `rounding_amount_out_of_range`. With `0` the document has no rounding amount in the UBL.
preceding_invoiceNoPreceding invoice reference — the earlier invoice this document corrects, for example the invoice a credit note credits. Allowed on both `invoice` and `credit_note`; one reference per document. The value is an opaque reference that you supply. It is not looked up or checked against an earlier peppol.sh document. It is emitted as `cac:BillingReference/cac:InvoiceDocumentReference`.
confirmation_handleNoLive only. The confirmation_handle of the preview. It works once, for 10 minutes, with the same API key and the same document.

Output Schema

NameRequiredDescriptionDefault
modeYes
sentYesTrue when the document was accepted for sending.
previewYesLive only: the document as it will be sent. Its text comes from the document, not from peppol.sh.
documentYes
expires_atYes
credit_costYes
credits_remainingYesThe credit balance of the workspace after this call.
confirmation_handleYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond annotations by explaining idempotency behavior (same key does not send twice), credit cost (0 for sandbox, 1 for live), the two-call preview-and-confirm protocol with a 10-minute handle, and why a sandbox send may still be presented as destructive. The destructiveHint=true annotation is explicitly reconciled with the sandbox/live distinction.

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?

The text is front-loaded with purpose, then ordered from validation to idempotency to sandbox/live flow to the destructive mark. It is dense but each sentence carries operational value; no filler sentences are present.

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 complex 27-parameter mutation tool with annotations and an output schema, the description covers the essential preconditions (validate first), cost model, confirmation workflow, and workspace setting. It does not describe all request parameters, but the schema and output schema carry that burden.

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?

The description adds valuable semantics for idempotency_key, confirm, and confirmation_handle, and explains key-type behavior (ps_test_ vs ps_live_). However, with 27 parameters and 74% schema coverage, most parameter meaning still comes from the schema itself, and the description does not compensate for the remaining undocumented parameters.

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 opening sentence gives a specific verb (Sends), resources (invoice or credit note), transport (over Peppol), input (from JSON) and endpoint (POST /v1/documents). It is clearly distinct from siblings such as validate_document, get_document, and list_documents.

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 states to call validate_document first, then distinguishes sandbox (ps_test_) from live (ps_live_) behavior, including that live sends require the workspace setting 'Allow live sends from MCP'. It also prescribes the two-call confirmation flow and when to use confirm/confirmation_handle.

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.

Resources