Skip to main content
Glama

siigo_get_invoice_pdf

Retrieve PDF invoices from Siigo accounting software by providing the invoice ID to access and download financial documents.

Instructions

Get invoice PDF

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID

Implementation Reference

  • Core handler function that performs the authenticated GET request to Siigo API to fetch the invoice PDF as base64.
    async getInvoicePdf(id: string): Promise<SiigoApiResponse<{ base64: string }>> { return this.makeRequest<{ base64: string }>('GET', `/v1/invoices/${id}/pdf`); }
  • MCP server wrapper handler that calls SiigoClient.getInvoicePdf and formats the response for MCP.
    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's getTools() method, including name, description, and input schema.
    { name: 'siigo_get_invoice_pdf', description: 'Get invoice PDF', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Invoice ID' }, }, required: ['id'], }, },
  • Dispatcher switch case that routes the tool call to the specific handler.
    case 'siigo_get_invoice_pdf': return await this.handleGetInvoicePdf(args);
  • Helper method used by all API calls, including authentication and axios request handling.
    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