_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.
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": {
"transactions": "<transactions>",
"transaction_id": "<transaction_id>",
"id_type": "<id_type>"
},
"name": "_find_transaction_by_id"
}
}Input 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