Title: Gemini 2.5 Pro file_search and function_declarations

I encountered unexpected behavior with the generateContent endpoint in Gemini 2.5 Pro.

I sent a request including: file_search tool and a list of function_declarations

Instead of performing file_search, the model returned:

“functionCall”: { “name”: “query”, … }

Note that “query” is not in my list of function_declarations.

Interestingly, when I send the same request without function_declarations, the model executes file_search correctly.

My questions:

  1. Why does the model return a function_call (query) that I did not define in my request - function_declarations, instead of using the file_search tool?

  2. Currently, Code Execution is not supported together with function_declarations in a single request. Will this be supported in the future?