get_credit_note_pdf
Download credit notes as PDF files from Siigo's electronic invoicing system. Provide the credit note ID to retrieve the PDF content in base64 format for decoding and use.
Instructions
Download a credit note as PDF.
Args: credit_note_id: The credit note'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 |
|---|---|---|---|
| credit_note_id | Yes |
Implementation Reference
- Handler function that downloads the credit note PDF from the Siigo API and returns it as a base64-encoded string.@mcp.tool async def get_credit_note_pdf(ctx: Context, credit_note_id: str) -> str: """Download a credit note as PDF. Args: credit_note_id: The credit note'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"/credit-notes/{credit_note_id}/pdf") return base64.b64encode(pdf_bytes).decode("utf-8")
- Discovery index entry defining the tool's name, category, and summary for dynamic schema generation.{"name": "get_credit_note_pdf", "category": "credit_notes", "summary": "Download credit note as PDF"},
- src/siigo_mcp/tools/discovery.py:106-106 (registration)Registers the tool by mapping its name to the implementation in the lazy-loading tool functions dictionary."get_credit_note_pdf": credit_notes.get_credit_note_pdf,