Export a report file
export_reportProduces a downloadable FILE of a report and returns its link: the balance sheet, the income statement or the account statement as CSV, XLS (a real .xlsx workbook) or PDF, and the journal (every leg of every booking in the period, chronological) as PDF only. Use it when the user wants the report itself to download, print, send or open in a spreadsheet; for the figures, call the matching get_* tool instead. date_to is the balance sheet's report date and every other report's period end; date_from is required for the three period reports. The account statement takes the same scope / account inputs as get_account_statement. The result is {status, url, file_name}: give the user the url as a link to click. The link is signed and short-lived — hours, not days — so do not store or repeat it later; if it has expired, export again. status 'processing' means the statement was too large to build in one request: it is prepared in the background, the download link is e-mailed to the user and it also appears under their personal settings, My exports. Amounts in the file are in the company's home currency.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"report": "<report>",
"format": "<format>",
"date_to": "<date_to>",
"company_id": "<company_id>"
},
"name": "export_report"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | account_statement only: 'single' for one account, 'range' for a band of account numbers, 'all' (default) for every account. | |
| format | Yes | File format. The journal is PDF only. | |
| report | Yes | Which report to export. | |
| account | No | account_statement, scope 'single': the account's number. | |
| date_to | Yes | End of the period, YYYY-MM-DD, inclusive; for the balance sheet the report date (balances up to and including it). | |
| date_from | No | Start of the period, YYYY-MM-DD, inclusive — required for every report except the balance sheet. | |
| company_id | Yes | The company to work on — one of list_my_companies' company_id values. | |
| compare_to | No | balance_sheet: a second report date; income_statement: end of the compare period (with compare_from). YYYY-MM-DD. | |
| to_account | No | account_statement, scope 'range': the last account number. | |
| compare_from | No | income_statement only: start of the compare period, YYYY-MM-DD; only with compare_to. | |
| from_account | No | account_statement, scope 'range': the first account number. | |
| show_all_accounts | No | balance_sheet / income_statement: include accounts with no bookings. |