Assistance need to get json output from CrewAI task

We’ve developed a agent to generate a sql query, by giving a table structure (table name, columns with description about column) and user question. This query will generate to answer the user question. We expect output as a json as below format.

We noted that agent is working fine but time to time it gives output json with some description (example: my best complete final answer to the task, the final answer to the original input question like wording coming inaddition to the json), as example below. Due to this json validation failure got happened and program getting failed.

Any idea how we can overcome this?

Incorrect json:
my best complete final answer to the task
[{
“query”: “SELECT MANAGER_FULL_NAME, MANAGER_WORK_EMAIL FROM schema.tableName WHERE EMPLOYEE_NUMBER = ‘12345’;”
}]