Skip to main content
Glama

siigo_get_invoices

Retrieve invoice lists from Siigo accounting software with date range and pagination filters for financial management.

Instructions

Get list of invoices from Siigo

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number
page_sizeNoNumber of items per page
created_startNoStart date filter (YYYY-MM-DD)
created_endNoEnd date filter (YYYY-MM-DD)

Implementation Reference

  • Core handler function in SiigoClient that performs the authenticated GET request to the Siigo /v1/invoices API endpoint.
    async getInvoices(params?: { page?: number; page_size?: number; created_start?: string; created_end?: string }): Promise<SiigoApiResponse<SiigoInvoice>> { return this.makeRequest<SiigoInvoice>('GET', '/v1/invoices', undefined, params);
  • MCP server wrapper handler that calls SiigoClient.getInvoices and returns formatted JSON response.
    private async handleGetInvoices(args: any) { const result = await this.siigoClient.getInvoices(args); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], };
  • src/index.ts:350-362 (registration)
    Tool registration in getTools() method, defining name, description, and input schema.
    { name: 'siigo_get_invoices', description: 'Get list of invoices from Siigo', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, created_start: { type: 'string', description: 'Start date filter (YYYY-MM-DD)' }, created_end: { type: 'string', description: 'End date filter (YYYY-MM-DD)' }, }, }, },
  • TypeScript interface defining the structure of a Siigo invoice (output schema).
    export interface SiigoInvoice { id?: string; document: { id: number; number?: number; }; date: string; customer: { person_type?: string; id_type?: string; identification: string; branch_office?: number; name?: string[]; address?: any; phones?: any[]; contacts?: any[]; }; cost_center?: number; currency?: { code: string; exchange_rate: number; }; seller: number; observations?: string; items: Array<{ code: string; description?: string; quantity: number; price: number; discount?: number; taxes?: Array<{ id: number }>; }>; payments: Array<{ id: number; value: number; due_date?: string; }>; stamp?: { send: boolean; }; mail?: { send: boolean; }; global_discounts?: Array<{ id: number; percentage?: number; value?: number; }>; additional_fields?: any; }
  • Helper method that handles authentication, makes the Axios HTTP request, and processes responses/errors for all API calls.
    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