If the case is purely to have a widget on course home page that contains dynamic information the most effective solution is probably to use a "Remote Plugin Widget".
These can be set up by administrators uing the "Manage Remote Plugins" tool.
They Remote Plugins effectively just combine LTI launches into iframes and make them available as widgets when you are configuring home pages(or in other areas of the system). There are examples posted of how to use this for richer server side applications.
The LTI launch itself passes information on where it is being launched from (i.e. context related information).
In your case it looks like just hosting a static page containing javascript would work. Then you could use the javascript to inspect the query string. (A bit tricky to test the LTI signatures from javascript safely, if you care about trust at that point...)
Also, Valence APIs (the GET calls) can be used from the javascript if you need to supplement with other information that is available.