get_transaction_group
Retrieve detailed information about a specific transaction group in LunchMoney by providing the transaction group ID to access financial data.
Instructions
Get details of a transaction group
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Implementation Reference
- src/tools/transactions.ts:483-527 (registration)Registration of the 'get_transaction_group' tool using server.tool(), including schema definition and handler implementation. Fetches transaction group details from LunchMoney API endpoint /transactions/group/{id}.server.tool( "get_transaction_group", "Get details of a transaction group", { input: z.object({ transaction_id: z .number() .describe("ID of the transaction group"), }), }, async ({ input }) => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch( `${baseUrl}/transactions/group/${input.transaction_id}`, { headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, } ); if (!response.ok) { return { content: [ { type: "text", text: `Failed to get transaction group: ${response.statusText}`, }, ], }; } const result = await response.json(); return { content: [ { type: "text", text: JSON.stringify(result), }, ], }; } );
- src/tools/transactions.ts:493-527 (handler)Handler function that makes an authenticated GET request to the LunchMoney API to retrieve details of a specific transaction group by ID and returns the JSON result.async ({ input }) => { const { baseUrl, lunchmoneyApiToken } = getConfig(); const response = await fetch( `${baseUrl}/transactions/group/${input.transaction_id}`, { headers: { Authorization: `Bearer ${lunchmoneyApiToken}`, }, } ); if (!response.ok) { return { content: [ { type: "text", text: `Failed to get transaction group: ${response.statusText}`, }, ], }; } const result = await response.json(); return { content: [ { type: "text", text: JSON.stringify(result), }, ], }; } );
- src/tools/transactions.ts:487-491 (schema)Zod input schema requiring a numeric transaction_id for the transaction group.input: z.object({ transaction_id: z .number() .describe("ID of the transaction group"), }),