get_credit_note_pdf
Download a credit note as a PDF file using its unique ID. Returns base64-encoded PDF content 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
- The core handler function for the 'get_credit_note_pdf' tool. It fetches the PDF from the Siigo API endpoint 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")
- src/siigo_mcp/tools/discovery.py:106-106 (registration)Maps the tool name 'get_credit_note_pdf' to its implementation in the credit_notes module for dynamic tool loading in lazy mode."get_credit_note_pdf": credit_notes.get_credit_note_pdf,
- Metadata entry in TOOL_INDEX providing the tool's name, category, and summary description, used for tool discovery via list_siigo_tools.{"name": "get_credit_note_pdf", "category": "credit_notes", "summary": "Download credit note as PDF"},