Skip to main content
Glama
Unofficial Lexware Office MCP Server

Unofficial Lexware Office MCP Server

download_document

Read-only

Save a rendered PDF or XML of an invoice or sales document by type and ID; returns path and URI without file bytes.

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. Addedv0.8.3

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond readOnlyHint=true by disclosing call cost ('One API call'), the return shape ('Reports `path` and `uri` and keeps the bytes out of the answer'), and the failure modes that aren't mutation-related but domain-related (unrendered drafts, XML-only XRechnung). The local file write is disclosed indirectly via 'Save' and the reported `path`, so the agent knows a filesystem artifact appears even though no API state changes.

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?

Front-loaded with the action, then the return shape, then the alternative tool, then the edge cases — every sentence carries information. Slightly penalized for hard line breaks that split sentences mid-clause and make the middle paragraph harder to scan than a single tight block would be.

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 needn't be spelled out, yet the description still gives the essential shape (path/uri, bytes not inlined). With the draft/XRechnung/ZUGFeRD caveats and the get_deeplink cross-reference, an agent has everything needed to call this correctly or pick the alternative.

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% and the schema already explains the document_id source, the pdf/xml enum and its not-found behavior, and the duplicate spelling variants. The description's only added semantic link is tying the XRechnung/Xml case to file_format, which is marginal over the schema; 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') and immediately differentiates itself from the download_file sibling by saying it behaves 'exactly as download_file does', while noting get_deeplink is the tool for clickable links.

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 routes the agent: use this to save bytes, use get_deeplink 'with the same id' for a human-clickable link. It also names three when-not conditions (drafts are unrendered, XRechnung PDFs are preview-only, ZUGFeRD is a PDF with embedded XML), which is more exclusion guidance than most tools provide.

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