reconcile_account
Qué hace
Sección titulada «Qué hace»Compare an account with the balance your bank shows, then reconcile it.
Give the balance shown by the bank today (currency units). If YNAB’s cleared
balance differs, nothing is written: the result explains the gap with the
pending transactions, the one whose amount matches the difference
(explained_by) and likely duplicates. Fix those first (with the user), then
call again. Only if the user wants to accept the remaining gap, call with
adjust=true: a “Balance adjustment” transaction is added to Ready to Assign.
When balances match, every cleared transaction is marked reconciled after the
user confirms (as for apply_categories). undo_operation reverts it.
Comportamiento
Sección titulada «Comportamiento»| Tipo | escritura — oculta sin AVENIR_MCP_WRITE=1 |
| Confirmación | sí: vista previa y aplicación tras el acuerdo del usuario |
| Deshacer | sí, con undo_operation |
| Destructiva | sí |
| Idempotente | no |
| Peticiones a YNAB | 2 para el ejemplo de abajo, con la caché vacía |
Parámetros
Sección titulada «Parámetros»| Nombre | Tipo | Obligatorio | Por defecto | Descripción |
|---|---|---|---|---|
plan_id |
string | sí | — | YNAB plan id or ‘last-used’. |
account_id |
string | sí | — | Account to reconcile (from list_accounts). |
bank_balance |
number | sí | — | In currency units, negative for money out; at most a billion either way. |
adjust |
boolean | no | false |
Record the remaining difference as an adjustment. |
confirmation |
string | null | no | null |
Code from a previous “confirmation_required” result. |
Devuelve
Sección titulada «Devuelve»| Campo | Tipo | Descripción |
|---|---|---|
status |
“applied” | “confirmation_required” | “declined” | “nothing_to_do” | “difference_found” | Outcome: difference_found (nothing changed; see analysis), confirmation_required, applied, declined, or nothing_to_do (already reconciled). |
message |
string | What happened and what to do next, for the agent to relay. |
account |
string | Account name. |
analysis |
object | The comparison with the bank. |
analysis.account_id |
string | The account analysed. |
analysis.bank_balance |
number | Balance the bank shows, as given. |
analysis.cleared_balance |
number | Sum of the account’s cleared and reconciled transactions in YNAB. |
analysis.working_balance |
number | Sum of all the account’s transactions, cleared or not. |
analysis.difference |
number | Bank balance minus cleared balance; negative when YNAB counts more money than the bank. |
analysis.to_reconcile_count |
integer | Cleared transactions not yet reconciled. |
analysis.uncleared_count |
integer | Transactions the bank has not shown yet. |
analysis.uncleared |
array of object | Up to 50 of them. |
analysis.explained_by |
array of string | Uncleared transactions whose amount equals the difference. |
analysis.possible_duplicates |
array of array of string | Pairs with the same amount and merchant, at most 3 days apart, over the last 60 days. |
adjustment |
number | null | Amount of the balance adjustment created, if adjust was requested; else null. |
confirmation |
string | null | Single-use code confirming exactly this preview, valid 10 minutes; null unless status is confirmation_required. |
operation_id |
string | null | Journal id of the applied operation, for undo_operation; null unless status is applied. |
Ejemplo
Sección titulada «Ejemplo»Argumentos:
{ "plan_id": "demo-budget", "account_id": "acc-checking", "bank_balance": 3440.8}Respuesta sobre el presupuesto de demostración:
{ "status": "difference_found", "message": "YNAB's cleared balance differs from the bank by -71.86. Nothing was changed. Check explained_by, uncleared and possible_duplicates with the user; call again once fixed, or with adjust=true to record the gap as an adjustment.", "account": "Checking", "analysis": { "account_id": "acc-checking", "bank_balance": 3440.8, "cleared_balance": 3512.66, "working_balance": 3512.66, "difference": -71.86, "to_reconcile_count": 49, "uncleared_count": 0, "uncleared": [], "explained_by": [], "possible_duplicates": [ [ "tx-050", "tx-051" ] ] }, "adjustment": null, "confirmation": null, "operation_id": null}Errores
Sección titulada «Errores»Account {account_id} is not in this plan: use an id from list_accounts.This client cannot ask the user to confirm, and AVENIR_MCP_REQUIRE_ELICITATION=1 forbids confirmation codes: nothing was changed. Use a client that supports MCP elicitation, or unset the variable.This confirmation code is unknown, expired, already used, or was issued for different changes. Call again without confirmation to get a new preview.Confirmation codes are disabled (AVENIR_MCP_REQUIRE_ELICITATION=1): call again without confirmation, and the user answers in the client.The plan changed between the preview and the answer. Call again without an answer to get a new preview.
Los errores propios de YNAB llegan como Error calling tool '<tool>': YNAB <status>: <detail>.
Ver también
Sección titulada «Ver también»Proyecto no oficial. «We are not affiliated, associated, or in any way officially connected with YNAB or any of its subsidiaries or affiliates.» No estamos afiliados, asociados ni conectados oficialmente con YNAB. YNAB y You Need A Budget son marcas registradas de YNAB. avenir-mcp se ofrece tal cual, sin garantía, y no es asesoramiento financiero. Aviso legal