Skip to main content
Glama

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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")
  • 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"},
Behavior3/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 explains the output format ('PDF content as base64-encoded string') and decoding instructions, which adds useful context beyond basic functionality. However, it doesn't cover potential errors, authentication needs, or rate limits, leaving gaps for a tool that likely involves data retrieval.

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 highly concise and well-structured: a clear purpose statement, a parameter explanation, and return value details in three sentences. Every sentence adds value, with no wasted words, and it's front-loaded with the core functionality.

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, the description is mostly complete. It covers the purpose, parameter meaning, and output handling, but lacks details on error cases or usage constraints, which could be helpful for robust agent operation.

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, but the description compensates by explaining the 'invoice_id' parameter as 'The invoice's GUID', adding semantic meaning that the schema lacks. Since there's only one parameter, this is sufficient to clarify its purpose, though it could note format constraints (e.g., UUID).

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 an invoice as PDF') and resource ('invoice'), distinguishing it from siblings like 'get_invoice' (which likely returns metadata) and 'get_credit_note_pdf' (a different document type). It uses precise language that leaves no ambiguity about the tool's function.

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

Usage Guidelines4/5

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

The description implies usage context by specifying 'invoice' and referencing the 'invoice_id' parameter, which helps differentiate it from tools like 'get_credit_note_pdf'. However, it lacks explicit guidance on when to use this versus alternatives such as 'get_invoice' for non-PDF data or prerequisites for accessing invoices.

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