Analytics using openAI assistant API

Hey folks
I am building an application where I am trying to provide analysis to the user given the user’s query in nlp.
I have data stored in mongodb.
Currently I have created a file where I have mentioned the table schema with some metadata like business context and have provided this file to assistant so that it can form mongoDB queries.
Is this the only and correct way of doing this? We have multiple tables so can’t provide in context.