Skip to main content
Glama
Unofficial Lexware Office MCP Server

Unofficial Lexware Office MCP Server

download_document

Read-only

Fetches and saves the rendered PDF or XML of an invoice or sales document by its Lexware ID, returning the file path and URI.

Instructions

Save the rendered PDF of an invoice or another sales document.

One API call. Reports path and uri and keeps the bytes out of the answer, exactly as download_file does. For a link a person can click, call get_deeplink with the same id.

A draft has not been rendered and cannot be downloaded. An XRechnung is XML by nature and its PDF is only a preview. A ZUGFeRD document is a PDF with the XML inside it.

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": {
      "document_type": "<document_type>",
      "document_id": "<document_id>"
    },
    "name": "download_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
document_idYesThe document's Lexware id, as returned by search_vouchers.
file_formatNoWhich representation to fetch. 'pdf' is what almost everything has. 'xml' only exists for an XRechnung, and asking for it otherwise is a not-found.pdf
document_typeYesWhich kind of document this is. Take it from the `voucherType` search_vouchers reported, where a sales invoice is 'invoice'. Either spelling works, 'creditnote' or 'credit-note'.

Output Schema

NameRequiredDescriptionDefault
uriYesResource URI for the same file. Read it to get the bytes, wherever the server runs.
pathYesWhere the file was written on the server.
sizeYesSize in bytes.
mimeTypeYesThe file's content type.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.11.0
    • removedInput schema / properties / document_id / title
      Removed value: -"Document Id"
    • removedInput schema / properties / document_type / title
      Removed value: -"Document Type"
    • removedInput schema / properties / file_format / title
      Removed value: -"File Format"
    • removedInput schema / title
      Removed value: -"download_documentArguments"
    • changedOutput schema / description
      Previous value: -"What a download reports back.\n\nDeclared as a model rather than a bare dict so the schema the client sees\nsays what the fields are. `path` and `uri` name the same file: the path is\nusable when the client shares a machine with the server, the URI when it\ndoes not."New value: +"What a download reports back."
    • removedOutput schema / properties / mimeType / title
      Removed value: -"Mimetype"
    • removedOutput schema / properties / path / title
      Removed value: -"Path"
    • removedOutput schema / properties / size / title
      Removed value: -"Size"
    • removedOutput schema / properties / uri / title
      Removed value: -"Uri"
    • removedOutput schema / title
      Removed value: -"Download"
  2. Addedv0.8.3

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the description's main added value is the operational detail: one API call, `path`/`uri` reported, bytes kept out of the answer. The domain caveats (draft not rendered, XRechnung PDF is preview-only, ZUGFeRD embeds XML in the PDF) are genuinely useful behavioral context. It stops short of stating where the file lands on disk or what happens on repeat downloads, and 'Save' sits in slight tension with readOnlyHint since a local file is written — worth noting but not a direct contradiction.

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?

Four short blocks, each doing distinct work: purpose, behavior, alternative routing, and edge cases. Front-loaded with the verb+resource, and no sentence is filler.

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?

An output schema exists, so return values need no explanation; annotations cover the safety profile; and the description closes the real gaps an agent would hit — drafts, XRechnung XML, ZUGFeRD packaging. Nothing needed to call it correctly is missing.

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 explains `document_id`, `document_type` spellings, and the `file_format` enum. The description only echoes `file_format` semantics via the XRechnung/XML remark and hints the id is the same one used elsewhere, which is reinforcing rather than new. Baseline 3 is appropriate.

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 and resource: 'Save the rendered PDF of an invoice or another sales document.' It immediately separates itself from `download_file` (same byte-omitting behavior) and `get_deeplink` (clickable link), so an agent can route correctly 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 Guidelines5/5

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

Gives explicit alternatives with the condition that selects them: use `get_deeplink` when a person-clickable link is wanted, and this tool when the rendered file is wanted. It also states when-not: drafts cannot be downloaded, and XRechnung XML is not a true PDF rendering.

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