The update-bank-transaction tool fails with a generic "An unexpected error occurred while communicating with Xero" whenever the lineItems parameter is included, regardless of other inputs. Because accountCode lives inside lineItems, this makes it impossible to recategorise existing bank transactions via the MCP server.
Steps to reproduce:
Create or retrieve any AUTHORISED, unreconciled bank transaction via the MCP.
Call update-bank-transaction with a minimal valid payload:
json
{
"bankTransactionId": "<existing-id>",
"type": "SPEND",
"lineItems": [{
"description": "test",
"quantity": 1,
"unitAmount": 10,
"accountCode": "404",
"taxType": "BASEXCLUDED"
}]
}
Returns: "Error updating bank transaction: An unexpected error occurred while communicating with Xero"
What works (control):
Same tool with the same bankTransactionId succeeds if you only update contactId, date, type, or reference — i.e., any combination of top-level fields without lineItems. This rules out auth / permissions / tenant-resolution / rate-limiting.
Variables tested (all reproduce the failure):
taxType values: BASEXCLUDED, NONE, INPUT, OUTPUT
type: both RECEIVE and SPEND
Source data: bank transactions originally created via API ranging from 2016 through 2026
With and without tracking on the line item
With and without reference on the top-level call
Minimal one-line lineItems and multi-line lineItems
Impact:
Cannot perform a very common workflow — bulk recoding existing bank transactions from a holding account (e.g., #850 Suspense) into their correct chart-of-accounts code after initial import. End users have to fall back to the Xero UI for what should be a programmatic operation.
Suspected cause:
The generic error message strongly suggests the underlying SDK exception is being swallowed in src/handlers/update-bank-transaction.handler.ts. Logging the raw error or axios response body would help. Possible upstream causes:
Payload shape mismatch — e.g., the Xero BankTransactions PUT endpoint may require BankAccount.AccountID in the body when LineItems is present (not currently in the tool schema)
LineItem.LineAmount may be required and not auto-derived from UnitAmount × Quantity on update calls
Reference field may be required when updating (not just optional)
Environment:
MCP server: xero-mcp-server main branch
Auth: Custom Connection (client credentials)
Tested on Australian Xero org (BosHQ trust)
Workaround:
Use the Xero UI's Find & Recode feature, or re-create the bank transaction (delete the existing + create new with correct accountCode).
The
update-bank-transactiontool fails with a generic"An unexpected error occurred while communicating with Xero"whenever thelineItemsparameter is included, regardless of other inputs. BecauseaccountCodelives insidelineItems, this makes it impossible to recategorise existing bank transactions via the MCP server.Steps to reproduce:
Create or retrieve any AUTHORISED, unreconciled bank transaction via the MCP.
Call
update-bank-transactionwith a minimal valid payload:Returns: "
Error updating bank transaction: An unexpected error occurred while communicating with Xero"What works (control):
Same tool with the same
bankTransactionIdsucceeds if you only updatecontactId, date, type, or reference— i.e., any combination of top-level fields withoutlineItems. This rules out auth / permissions / tenant-resolution / rate-limiting.Variables tested (all reproduce the failure):
taxTypevalues:BASEXCLUDED, NONE, INPUT, OUTPUTtype: both
RECEIVEandSPENDSource data: bank transactions originally created via API ranging from 2016 through 2026
With and without
trackingon the line itemWith and without
referenceon the top-level callMinimal one-line lineItems and multi-line lineItems
Impact:
Cannot perform a very common workflow — bulk recoding existing bank transactions from a holding account (e.g., #850 Suspense) into their correct chart-of-accounts code after initial import. End users have to fall back to the Xero UI for what should be a programmatic operation.
Suspected cause:
The generic error message strongly suggests the underlying SDK exception is being swallowed in
src/handlers/update-bank-transaction.handler.ts. Logging the raw error oraxiosresponse body would help. Possible upstream causes:Payload shape mismatch — e.g., the Xero
BankTransactionsPUT endpoint may requireBankAccount.AccountIDin the body whenLineItemsis present (not currently in the tool schema)LineItem.LineAmountmay be required and not auto-derived fromUnitAmount × Quantityon update callsReferencefield may be required when updating (not just optional)Environment:
MCP server: xero-mcp-server main branch
Auth: Custom Connection (client credentials)
Tested on Australian Xero org (BosHQ trust)
Workaround:
Use the Xero UI's
Find & Recodefeature, or re-create the bank transaction (delete the existing + create new with correctaccountCode).