get_expense_report
Retrieve specific expense report details by ID from Autotask PSA to track costs, review expenses, and manage financial records.
Instructions
Get a specific expense report by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reportId | Yes | The expense report ID to retrieve |
Implementation Reference
- src/handlers/tool.handler.ts:731-744 (registration)Tool registration including name, description, and input schema definition in listTools() method{ name: 'get_expense_report', description: 'Get a specific expense report by ID', inputSchema: { type: 'object', properties: { reportId: { type: 'number', description: 'The expense report ID to retrieve' } }, required: ['reportId'] } },
- src/handlers/tool.handler.ts:1246-1249 (handler)Handler logic in callTool() switch statement that delegates to autotaskService.getExpenseReport()case 'get_expense_report': result = await this.autotaskService.getExpenseReport(args.reportId); message = `Expense report retrieved successfully`; break;
- Core service method that performs the actual API call to retrieve the expense report using the autotask-node clientasync getExpenseReport(id: number): Promise<AutotaskExpenseReport | null> { const client = await this.ensureClient(); try { this.logger.debug(`Getting expense report with ID: ${id}`); const result = await client.expenses.get(id); return result.data as unknown as AutotaskExpenseReport || null; } catch (error) { this.logger.error(`Failed to get expense report ${id}:`, error); throw error; } }