Get merge request ID into our deploy job

Hi Im working on creating a way to be able to grab the merge request ID from the .gitlab-ci.yml whenever a merge request happens. I would then like to grab the ID of that merge request and pass it to the Gitlab API and do some additional checks on the merge request. This last part I have already figured out but I want to grab the ID dynamically from the merge request and pass it to my ci.yml file and this is where I’m struggling. Is there any way of doing this?