Combining fileSearch e functionDeclarations in Gemini API

I’m having trouble combining the fileSearch (RAG) and functionCalling tools. They work fine individually, but when both are enabled, the documentation search fails. Has anyone had any experience with this? I also tried to be very detailed with the system instructions.

"tools": [
    {
        "functionDeclarations": [
            {
                "name": "support_count",
                "description": ...
				...
            },
        ]
    },
    {
        "fileSearch": {
            "fileSearchStoreNames": [
                "fileSearchStores/my-store-nsr9z3mjvyd3"
            ]
        }
    }
]
1 Like

Hi @electro ,

Welcome to the Forum!
Thank you for reaching out!
Could you please let us know which Gemini Model you are using?

Thanks. I tried with the gemini-2.5-flash and gemini-2.5-pro models: the file search doesn’t work, and the function calling tool always has top priority. I’m interested to know if anyone has successfully combined both tools…

Hi @electro, Thanks for sharing the details. Please note that Multi-tool use is a-Live API only feature at the moment. The run() function declaration, which handles the asynchronous websocket setup, is omitted for brevity.
multi_tool_calling