Undo ATO import
undo_ato_importUndo an ATO statement import by deleting only the lines it created and restoring the account’s prior opening balance and date; preview changes first with a dry run.
Instructions
DESTRUCTIVE: take an ATO statement import back out of its account — deletes every line that import created and puts back the opening balance and date it replaced. Lines it only updated or found unchanged, and lines typed in by hand, stay. dry_run defaults to true: it returns the preview (lines removed, their processed-date range, the balance and opening balance before and after, blockers) and writes nothing. Show the user the preview and get their go-ahead before calling again with dry_run: false. Refused (blockers) when a line it created is matched to a bank row (unmatch it first with match_ato_payment), when a financial year it touches is closed or lodged, or when a later import covers the same lines (undo that one first). Audit-logged with your reasoning and the removed lines.
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": {
"fund_id": "<fund_id>",
"ato_account_id": "<ato_account_id>",
"import_id": "<import_id>"
},
"name": "undo_ato_import"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | true (default): preview only, nothing written | |
| fund_id | Yes | Fund ID (discover via whoami or list_funds) | |
| import_id | Yes | The import to undo (from list_ato_imports) | |
| reasoning | No | Why you are making this change — recorded on the audit log entry for this write | |
| external_ref | No | Your stable ID for this write (e.g. a statement line or document reference). Repeating a call with the same external_ref replays the first result instead of writing twice. | |
| ato_account_id | Yes | ATO account ID (find via list_ato_accounts) |