_find_transaction_by_id
Locate specific transactions using their unique ID and ID type within the MCP YNAB Server, enabling precise retrieval and management of financial data.
Instructions
Find a transaction by its ID and ID type.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id_type | Yes | ||
| transaction_id | Yes | ||
| transactions | Yes |
Implementation Reference
- src/mcp_ynab/server.py:546-563 (helper)Helper function that implements the logic to find a transaction by ID, import_id, transfer_transaction_id, or matched_transaction_id.def _find_transaction_by_id( transactions: List[TransactionDetail], transaction_id: str, id_type: str ) -> Optional[TransactionDetail]: """Find a transaction by its ID and ID type.""" for txn in transactions: if ( (id_type == "id" and txn.id == transaction_id) or (id_type == "import_id" and txn.import_id == transaction_id) or ( id_type == "transfer_transaction_id" and txn.transfer_transaction_id == transaction_id ) or ( id_type == "matched_transaction_id" and txn.matched_transaction_id == transaction_id ) ): return txn return None