Skip to main content
Glama

siigo_get_invoice_pdf

Retrieve PDF documents for Siigo invoices by providing the invoice ID, enabling quick access to digital invoice copies for accounting and record-keeping purposes.

Instructions

Get invoice PDF

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID

Implementation Reference

  • Core handler implementing the tool logic: makes authenticated GET request to Siigo API endpoint `/v1/invoices/${id}/pdf` to retrieve the invoice PDF.
    async getInvoicePdf(id: string): Promise<SiigoApiResponse<{ base64: string }>> { return this.makeRequest<{ base64: string }>('GET', `/v1/invoices/${id}/pdf`); }
  • MCP server handler for the tool: extracts invoice ID from arguments and delegates to SiigoClient.getInvoicePdf, then formats response as text.
    private async handleGetInvoicePdf(args: any) { const result = await this.siigoClient.getInvoicePdf(args.id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • src/index.ts:420-430 (registration)
    Tool registration in MCP server: defines name, description, and input schema (requires 'id' string).
    { name: 'siigo_get_invoice_pdf', description: 'Get invoice PDF', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Invoice ID' }, }, required: ['id'], }, },
  • Switch case dispatching tool calls named 'siigo_get_invoice_pdf' to the specific handler.
    case 'siigo_get_invoice_pdf': return await this.handleGetInvoicePdf(args);
  • Helper method used by all API calls: handles authentication, makes HTTP request with axios, and processes responses/errors.
    private async makeRequest<T>(method: string, endpoint: string, data?: any, params?: any): Promise<SiigoApiResponse<T>> { await this.authenticate(); try { const response: AxiosResponse<SiigoApiResponse<T>> = await this.httpClient.request({ method, url: endpoint, data, params, }); return response.data; } catch (error: any) { if (error.response?.data) { return error.response.data; } throw new Error(`API request failed: ${error.message}`); } }

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/jdlar1/siigo-mcp'

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