get_expense_report
Retrieve a specific expense report by its ID to access detailed expense information and track spending within the Autotask PSA system.
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
- Core handler function that executes the logic to retrieve an expense report by ID using the AutotaskClient's expenses.get method.async 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; } }
- src/handlers/tool.handler.ts:731-744 (schema)Tool schema definition including input schema (reportId: number) and registration in the listTools() array.{ 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 (registration)Tool dispatch/registration in the callTool method's switch statement, invoking the service handler.case 'get_expense_report': result = await this.autotaskService.getExpenseReport(args.reportId); message = `Expense report retrieved successfully`; break;