siigo_get_credit_note
Retrieve a specific credit note from Siigo accounting software using its unique ID to access transaction details and documentation.
Instructions
Get a specific credit note by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Credit note ID |
Implementation Reference
- src/index.ts:981-984 (handler)The primary MCP tool handler function. It extracts the credit note ID from input arguments, calls the SiigoClient's getCreditNote method, and formats the result as a JSON text response.private async handleGetCreditNote(args: any) { const result = await this.siigoClient.getCreditNote(args.id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:460-466 (schema)Input schema for the tool, specifying that a string 'id' parameter is required.inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Credit note ID' }, }, required: ['id'], },
- src/index.ts:457-467 (registration)Tool registration in the getTools() method's return array, defining name, description, and input schema.{ name: 'siigo_get_credit_note', description: 'Get a specific credit note by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Credit note ID' }, }, required: ['id'], }, },
- src/siigo-client.ts:133-135 (helper)SiigoClient helper method that performs the authenticated GET API request to fetch the credit note by ID from Siigo's /v1/credit-notes/{id} endpoint.async getCreditNote(id: string): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', `/v1/credit-notes/${id}`); }
- src/siigo-client.ts:41-59 (helper)Core HTTP request helper in SiigoClient that handles authentication, makes Axios requests to Siigo API, and processes responses or 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}`); } }