From right here it is regular operate calling: your code runs the refund and sends again a function_result.
There isn’t any index to construct or host. Gemini runs the search on the server, so the one modifications to your code are the brand new instrument and a flag on the instruments you wish to defer. You possibly can maintain your most-used instruments loaded up entrance and defer the lengthy tail.
Software Retrieval additionally performs nicely with prefix caching. Deferred schemas keep out of the beginning of the immediate, and the schemas the mannequin masses are added later within the dialog, so the cached prefix stays the identical from flip to show.
Software Retrieval additionally works with remote MCP servers in the Gemini API. Set defer_loading: true on an mcp_server instrument and each instrument that server exposes is loaded on demand, so you may join a big server with out itemizing its instruments one after the other.
How client-side retrieval works
Should you preserve your personal instrument registry, embedding index, or per-user permission filter, declare the tool_search with "execution": "consumer" and outline your search parameters. Consumer-side retrieval provides one spherical journey per search, as a result of your app runs the lookup. Instruments don’t have to be declared upfront, so you can even expose new instruments mid-conversation when a consumer connects an integration:
