There could be a "source" optarg to indexCreate that is kept by the server and exposed as-is through indexStatus.
The drivers could automatically populate the optarg with the pretty-printed index function.
If the field is missing, the server could set it to a basic representation of the query (perhaps as an s-expression).