get_invoice_pdf
Download invoice documents as PDF files from the Siigo electronic invoicing system. Provide the invoice ID to retrieve base64-encoded PDF content for storage or sharing.
Instructions
Download an invoice as PDF.
Args: invoice_id: The invoice's GUID
Returns the PDF content as base64-encoded string. Decode with base64.b64decode() to get binary PDF.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice_id | Yes |
Implementation Reference
- src/siigo_mcp/tools/invoices.py:209-220 (handler)The main handler function for the 'get_invoice_pdf' tool. It fetches the invoice PDF from the Siigo API using get_client and returns it as a base64-encoded string.@mcp.tool async def get_invoice_pdf(ctx: Context, invoice_id: str) -> str: """Download an invoice as PDF. Args: invoice_id: The invoice's GUID Returns the PDF content as base64-encoded string. Decode with base64.b64decode() to get binary PDF. """ pdf_bytes = await get_client(ctx).get_pdf(f"/invoices/{invoice_id}/pdf") return base64.b64encode(pdf_bytes).decode("utf-8")
- src/siigo_mcp/tools/discovery.py:99-99 (registration)Registration of the 'get_invoice_pdf' tool in the lazy-loading tool function map used by dynamic execution."get_invoice_pdf": invoices.get_invoice_pdf,
- Tool metadata entry in the TOOL_INDEX list, providing name, category, and summary for discovery purposes.{"name": "get_invoice_pdf", "category": "invoices", "summary": "Download invoice as PDF"},