Skip to main content
Glama

Export document pdf

export_document_pdf
Read-only

Save a document (invoice, quote, credit note or any other kind) as a PDF in the business's Files, drawn as the customer sees it. Answers the new file's id and name: cite it as a file tag so the user can open and download it. Each call saves a new copy, so call it once per request. The file is kept, not imported into the books. A missing or another business's id is refused with reason document-not-found. With share true it also turns on the document's PUBLIC link and answers it as link (shared true): anyone who holds the link can open the document and download its PDF, so send it only to the customer. The link is the one the app's Copy link hands out, the same each call; it is switched off from the document's share settings, not by deleting the file. share true needs invoice write.

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": {
      "id": "<id>"
    },
    "name": "export_document_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe invoice, quote, credit note or other document to save as a PDF, from list_invoices or get_document.
shareNotrue also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / share
      Added value: +{
      +  "description": "true also turns on the document's public link and returns it as link, for the user to send the customer. Needs invoice write. Omit it to only save the PDF.",
      +  "type": "boolean"
      +}
  2. Added

TDQS

A3.8/5.0
Behavior1/5

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

The description discloses rich behavior (a new file copy per call, a persistent public link that anyone holding it can open and download from, a document-not-found refusal, and that the link is disabled from share settings rather than by deleting the file). However, it directly states the tool creates files and "turns on the document's PUBLIC link", which is a mutation of state, while the annotations declare readOnlyHint=true. That is an annotation contradiction.

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 the core action and return value, then layers on the share behavior and error case; most sentences carry distinct information. A few points are duplicated between description and schema ("share true needs invoice write", the id source) and the "Copy link" aside is wordy, but nothing 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?

There is no output schema, and the description compensates fully by naming the returned file id and name, the link and shared flag, and the document-not-found error reason. It also states the side-effect model (file kept, not booked) and the permission requirement, which is everything needed to call this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: share=true enables a public link usable by anyone who has it, requires invoice write permission, and the link is stable across calls and revoked elsewhere. It also adds the failure semantics for a missing or foreign-owned id.

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?

"Save a document (invoice, quote, credit note or any other kind) as a PDF in the business's Files, drawn as the customer sees it" gives a concrete verb, resource, destination and rendering rule. The clause "The file is kept, not imported into the books" separates it from save_document/import-style siblings, and the document scope separates it from export_report.

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 gives strong operational rules: call it once per request because each call saves a new copy, only send the link to the customer, and share=true requires invoice write. It does not explicitly name an alternative tool or a when-not-to-use condition, which keeps it below a 5.

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