siigo_get_vouchers
Retrieve cash receipt vouchers from Siigo accounting software for financial tracking and record management.
Instructions
Get list of vouchers (cash receipts) from Siigo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| page_size | No | Number of items per page |
Implementation Reference
- src/index.ts:481-491 (registration)Tool registration in getTools() method, defining the tool name, description, and input schema for pagination.{ name: 'siigo_get_vouchers', description: 'Get list of vouchers (cash receipts) from Siigo', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, }, }, },
- src/index.ts:991-993 (handler)MCP server handler that invokes the SiigoClient.getVouchers and formats the response.private async handleGetVouchers(args: any) { const result = await this.siigoClient.getVouchers(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
- src/index.ts:107-108 (handler)Dispatch case in the main switch statement for routing tool calls to the handler.case 'siigo_get_vouchers': return await this.handleGetVouchers(args);
- src/siigo-client.ts:142-144 (handler)Core handler in SiigoClient that performs the authenticated GET request to Siigo API endpoint /v1/vouchers with optional pagination parameters.async getVouchers(params?: { page?: number; page_size?: number }): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', '/v1/vouchers', undefined, params); }
- src/siigo-client.ts:41-59 (helper)Helper method used by all API calls, handling authentication, HTTP requests via Axios, and error 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}`); } }