Request Waypoints from Autopilot

Hello!
I am trying to request the list of waypoints that have been synced to my autopilot.

My setup is as follows: I have a ground station that is syncing waypoints to a simulated vehicle. Then I would like to be able to run a python script that connects to that simulated vehicle and pulls the list of waypoints.

Basically, I want to do in code what “wp list” does in the terminal. I just want to be able to request the list of waypoints so that way I can do some other math on it.

Does anyone know how to do this? I don’t really care what protocol it uses, mavlink/proxy.
Thanks!

You need to use the mission_request_list_send MAVLink message, pymavlink example here: pymavlink/mavutil.py at master · ArduPilot/pymavlink · GitHub