siigo_get_purchases
Retrieve purchase records from Siigo accounting software using pagination parameters to organize and access transaction data efficiently.
Instructions
Get list of purchases 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:1006-1009 (handler)MCP tool handler function that invokes SiigoClient.getPurchases with arguments and formats the result as JSON text response.private async handleGetPurchases(args: any) { const result = await this.siigoClient.getPurchases(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:519-525 (schema)Input schema defining optional pagination parameters (page, page_size) for the siigo_get_purchases tool.inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, }, },
- src/index.ts:516-526 (registration)Registration of the siigo_get_purchases tool in the getTools() array, advertised to MCP clients with description and schema.{ name: 'siigo_get_purchases', description: 'Get list of purchases from Siigo', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, }, }, },
- src/siigo-client.ts:155-157 (helper)SiigoClient helper method that performs the authenticated GET request to the Siigo API endpoint /v1/purchases with pagination params.async getPurchases(params?: { page?: number; page_size?: number }): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', '/v1/purchases', undefined, params); }
- src/siigo-client.ts:41-59 (helper)Core helper method in SiigoClient for making authenticated API requests, handling authentication, requests, and 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}`); } }