siigo_get_invoice
Retrieve a specific invoice from Siigo accounting software by providing its unique ID to access invoice details and records.
Instructions
Get a specific invoice by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Invoice ID |
Implementation Reference
- src/index.ts:902-912 (handler)The MCP tool handler for 'siigo_get_invoice' that extracts the invoice ID from arguments, calls SiigoClient.getInvoice, and returns the result as a formatted JSON text content block.private async handleGetInvoice(args: any) { const result = await this.siigoClient.getInvoice(args.id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:363-373 (registration)Registration of the 'siigo_get_invoice' tool in the MCP server's tool list, including its name, description, and input schema definition.{ name: 'siigo_get_invoice', description: 'Get a specific invoice by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Invoice ID' }, }, required: ['id'], }, },
- src/siigo-client.ts:104-106 (helper)Core implementation of the invoice retrieval in SiigoClient, which uses the shared makeRequest method to perform an authenticated GET request to the Siigo API endpoint `/v1/invoices/{id}`.async getInvoice(id: string): Promise<SiigoApiResponse<SiigoInvoice>> { return this.makeRequest<SiigoInvoice>('GET', `/v1/invoices/${id}`); }
- src/types.ts:94-143 (schema)TypeScript interface SiigoInvoice defining the structure of an invoice object, used as the generic type for the API response in getInvoice.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; }