siigo_get_voucher
Retrieve a specific voucher from Siigo accounting software using its unique ID to access detailed transaction information and financial records.
Instructions
Get a specific voucher by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Voucher ID |
Implementation Reference
- src/siigo-client.ts:146-148 (handler)Core implementation of the siigo_get_voucher tool. Makes a GET request to the Siigo API endpoint /v1/vouchers/{id} via the makeRequest helper, after authentication.async getVoucher(id: string): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', `/v1/vouchers/${id}`); }
- src/index.ts:996-999 (handler)MCP server wrapper handler that calls SiigoClient.getVoucher with the provided id and formats the response as MCP content.private async handleGetVoucher(args: any) { const result = await this.siigoClient.getVoucher(args.id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:109-110 (registration)Switch case in the CallToolRequest handler that routes 'siigo_get_voucher' calls to the appropriate handler method.case 'siigo_get_voucher': return await this.handleGetVoucher(args);
- src/index.ts:492-502 (schema)Tool registration in getTools() including name, description, and input schema definition for 'siigo_get_voucher'.{ name: 'siigo_get_voucher', description: 'Get a specific voucher by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Voucher ID' }, }, required: ['id'], }, },
- src/siigo-client.ts:41-59 (helper)Generic helper method used by getVoucher to handle authentication and make the HTTP request to Siigo API.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}`); } }