Include link to search query in alert

I am attempting to configure an alert message on a trigger to contain a URL which will replicate the search query that produced the result. I believe information on the query itself exists in ctx.monitor.inputs. I am unable to locate any documentation on this object (outside of docs saying it exists). When trying to do a trial-and-error inspection of the object, I found that I can’t run any functions inside of the template engine.

How can inspect ctx objects for debugging purposes? Is there a way to run any custom functions inside of the alert message template? Are there any existing solutions for replicating the search query of the monitor?