Create a tcl wrapper inside your package to hold the query. Call the tcl proc from the www/foo.tcl file.