siigo_get_credit_notes
Retrieve credit notes from Siigo accounting software to manage refunds, returns, and billing adjustments. Supports pagination for handling large datasets.
Instructions
Get list of credit notes 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/siigo-client.ts:129-131 (handler)Core handler function in SiigoClient that performs the GET request to the Siigo API endpoint for listing credit notes, using pagination parameters.async getCreditNotes(params?: { page?: number; page_size?: number }): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', '/v1/credit-notes', undefined, params); }
- src/index.ts:976-979 (handler)MCP server wrapper handler that calls SiigoClient.getCreditNotes and formats the response as MCP content.private async handleGetCreditNotes(args: any) { const result = await this.siigoClient.getCreditNotes(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:447-456 (registration)Tool registration in the MCP server's getTools() method, including name, description, and input schema.name: 'siigo_get_credit_notes', description: 'Get list of credit notes 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:449-456 (schema)Input schema definition for the siigo_get_credit_notes tool, specifying optional pagination parameters.inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number' }, page_size: { type: 'number', description: 'Number of items per page' }, }, }, },
- src/siigo-client.ts:41-59 (helper)Helper method used by all API calls, including getCreditNotes, to handle authentication and make HTTP requests with axios.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}`); } }