Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_get_invoice_pdf

Read-onlyIdempotent

Returns a temporary pre-signed URL to download an issued invoice PDF, waiting briefly for asynchronous generation so you can retrieve the document without building a polling loop.

Instructions

Returns a temporary pre-signed URL to download the invoice PDF.

  • URL: expires in five minutes and only allows GET.

  • Waiting: a PDF is produced asynchronously, so this request waits for it (up to ten seconds) instead of handing you a polling loop to write. Bound the wait with Prefer: wait=N, or opt out with Prefer: wait=0.

  • 202: only when the wait elapsed with the PDF still in flight. No body is returned; ask again after Retry-After.

  • Drafts: a draft has no fiscal PDF and answers 400 INVOICE_NOT_ISSUED_NO_PDF immediately — that one never waits. Issue it, or render it with GET …/{invoice_id}/pdf/preview.

  • Not registered with the AEAT: under VeriFactu the PDF carries the QR code of the invoice's registration. An invoice whose registration was rejected before reaching the AEAT, or that was voided without ever being registered, has no PDF and answers 400 INVOICE_NOT_REGISTERED_NO_PDF immediately. Its verifactu.error_message says why.

  • No TicketBAI code: under TicketBAI the PDF carries the invoice's TicketBAI code and its QR code. While the TicketBAI submission waits for an answer, the answer is 202; an invoice that has no TicketBAI code answers 400 INVOICE_NO_TICKETBAI_CODE_NO_PDF immediately.

  • Unavailable on our side: when the invoice needs its VeriFactu QR and BeeL. cannot produce the PDF, the answer is 409 INVOICE_PDF_UNAVAILABLE immediately instead of a 202 that would never end. Asking again does not help: contact support with the meta.request_id. Once it is solved, the same request returns the PDF.

  • Never modified: the PDF of an issued invoice is generated once — with its VeriFactu QR when it applies — and stays the document you delivered. Voiding the invoice or issuing a corrective against it does not change the PDF: read the invoice's status to know it.

BeeL API endpoint: GET /v1/companies/{company_id}/invoices/{invoice_id}/pdf (reference: https://docs.beel.es)

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": {
      "company_id": "<company_id>",
      "invoice_id": "<invoice_id>"
    },
    "name": "beel_get_invoice_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
company_idYesUnique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed.
invoice_idYesInvoice ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / invoice_id / type
      Added value: +"string"
  2. Changed3 schema fields changedv0.5.0
    • removedInput schema / $defs / UUID / example
      Removed value: -"550e8400-e29b-41d4-a716-446655440000"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / company_id / description
      Previous value: -"NIF (company) the operation acts on. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A NIF you do not reach answers `403`, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed."New value: +"Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed."
  3. First observedv0.3.1

TDQS

A4.3/5.0
Behavior5/5

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

Far exceeds the annotations, which only declare it is a safe, idempotent read. The description discloses the pre-signed URL's five-minute expiry and GET-only constraint, the synchronous wait behavior (up to ten seconds, tunable via `Prefer: wait`), and precise semantics for 202, 400, and 409 responses. It also explains that issued PDFs are immutable even after voiding or corrective issuance, which is exactly the kind of context an agent cannot get from structured fields.

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 core behavior, then organized into labeled bullets that each map to a distinct response case. It is longer than typical, and a few bullets (VeriFactu/TicketBAI background) are dense, but the length is largely justified by the number of distinguishable failure modes.

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?

With no output schema, the description does a good job covering the returned value (a temporary URL) and every error outcome, but it does not specify the 200 response body shape beyond 'pre-signed URL.' Otherwise an agent has everything needed to call it and interpret the result.

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%, including a thorough explanation of `company_id` and its 403 semantics, so the schema carries the parameter burden. The description adds no additional meaning about either path parameter, which matches the baseline for fully documented schemas.

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 first line states a specific verb and resource: 'Returns a temporary pre-signed URL to download the invoice PDF.' It also implicitly distinguishes itself from the preview path (`/{invoice_id}/pdf/preview`) referenced for drafts, so an agent can tell the issued-PDF download apart from the preview render.

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 bulleted failure modes effectively say when this tool will not work and what to do instead: drafts must be issued or rendered via the preview endpoint, unregistered invoices return a specific error, TicketBAI invoices behave differently. The alternative is expressed as an HTTP path rather than the sibling tool name (`beel_get_invoice_preview`), so a small inference is left to the agent, which keeps it from a 5.

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