Skip to main content
Glama

siigo_update_invoice

Modify existing invoice records in Siigo accounting software by providing the invoice ID and updated data to correct errors or reflect changes.

Instructions

Update an existing invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID
invoiceYesInvoice data to update

Implementation Reference

  • MCP tool handler that invokes SiigoClient.updateInvoice with args.id and args.invoice, formats the result as JSON text content.
    private async handleUpdateInvoice(args: any) { const result = await this.siigoClient.updateInvoice(args.id, args.invoice); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Core implementation that performs a PUT request to Siigo API endpoint /v1/invoices/{id} to update the invoice.
    async updateInvoice(id: string, invoice: Partial<SiigoInvoice>): Promise<SiigoApiResponse<SiigoInvoice>> { return this.makeRequest<SiigoInvoice>('PUT', `/v1/invoices/${id}`, invoice); }
  • src/index.ts:397-408 (registration)
    Tool registration in getTools() array, including name, description, and input schema.
    { name: 'siigo_update_invoice', description: 'Update an existing invoice', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Invoice ID' }, invoice: { type: 'object', description: 'Invoice data to update' }, }, required: ['id', 'invoice'], }, },
  • Type definition for SiigoInvoice used in updateInvoice parameters.
    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; }
  • Shared helper method that handles authentication, makes HTTP requests to Siigo API, 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