get_invoice_pdf
Download invoice PDFs from Siigo electronic invoicing software by providing the invoice ID. Returns base64-encoded PDF content for decoding and use.
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-221 (handler)The main handler function for the 'get_invoice_pdf' tool. It fetches the invoice PDF from the Siigo API endpoint and returns the content 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")
- Schema/description entry for 'get_invoice_pdf' in the TOOL_INDEX list used for tool discovery in lazy-loading mode.{"name": "get_invoice_pdf", "category": "invoices", "summary": "Download invoice as PDF"},
- src/siigo_mcp/tools/discovery.py:99-99 (registration)Registration of the 'get_invoice_pdf' tool function in the lazy-loaded _tool_functions dictionary."get_invoice_pdf": invoices.get_invoice_pdf,