siigo_get_journal
Retrieve a specific accounting journal by its ID from the Siigo accounting system to access detailed financial transaction records.
Instructions
Get a specific journal by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Journal ID |
Implementation Reference
- src/siigo-client.ts:201-203 (handler)Core tool implementation: performs authenticated GET request to Siigo API endpoint `/v1/journals/${id}` using the generic makeRequest helper.async getJournal(id: string): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', `/v1/journals/${id}`); }
- src/index.ts:1061-1064 (handler)MCP server wrapper handler for siigo_get_journal: extracts id from args, calls SiigoClient.getJournal, and returns JSON-formatted response.private async handleGetJournal(args: any) { const result = await this.siigoClient.getJournal(args.id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.ts:643-653 (registration)Tool registration in getTools(): defines name, description, and input schema (requiring 'id' parameter).{ name: 'siigo_get_journal', description: 'Get a specific journal by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Journal ID' }, }, required: ['id'], }, },
- src/index.ts:646-652 (schema)Input schema definition for the tool: object with required 'id' string property.inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Journal ID' }, }, required: ['id'], },
- src/siigo-client.ts:41-59 (helper)Generic helper for making authenticated HTTP requests to Siigo API, handling auth, errors, and response parsing.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}`); } }