Skip to main content
Glama

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
NameRequiredDescriptionDefault
credit_note_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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")
  • 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"},
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it downloads a PDF, returns base64-encoded content, and requires decoding. However, it lacks details on permissions, rate limits, or error handling, which would be useful for a download operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by clear sections for arguments and returns. Every sentence adds value: the first states the action, the second defines the parameter, and the third explains the output and decoding process, with no wasted words.

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?

Given the tool's low complexity (1 parameter) and the presence of an output schema (which handles return value documentation), the description is mostly complete. It covers the purpose, parameter semantics, and output handling. However, it lacks context on authentication, error cases, or sibling tool differentiation, which could enhance completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must compensate. It adds meaning by specifying that 'credit_note_id' is a 'GUID', which clarifies the parameter's format beyond the schema's generic string type. This is helpful, but it does not explain where to obtain this ID or provide examples, leaving some gaps.

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 description clearly states the specific action ('Download a credit note as PDF') and resource ('credit note'), distinguishing it from siblings like 'get_credit_note' (likely returns metadata) and 'get_invoice_pdf' (different document type). It uses precise terminology like 'base64-encoded string' and 'binary PDF' to clarify the output format.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a PDF download is needed, but does not explicitly state when to use this tool versus alternatives like 'get_credit_note' (for non-PDF data) or 'list_credit_notes' (for listing). It provides no guidance on prerequisites, error conditions, or exclusions, leaving usage context partially inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dsfaccini/siigo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server