400 Bad request

I am using Docker container for MCP server. When running my Python script to do a knn search, the server throws 400 Bad request. But when request is sent without anything inside query_body, it gives me the result. I couldn’t understand whats wrong within query_body. Please help if you can.

payload script:

payload = {
"jsonrpc": "2.0",
"id": 11,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"index": "chunking_test",
"query_body": {
"size": 10,
"query": {
"bool": {
"must_not": [{"term": {"type.keyword": {"value": "Image"}}}]
}
},
"knn": {
"field": "embedding",
"query_vector": query_vector,
"k": k,
"num_candidates": k*10
}
}
}
}
}

This is duplicate to thread