@langchain/google package supports Gemini’s built-in tools, which provide capabilities like web search grounding, code execution, URL context retrieval, and more. These tools are passed as Gemini-native objects to ChatGoogle via bindTools() or the tools call option.
Google Search
ThegoogleSearch tool grounds model responses with real-time Google Search results. This is useful for questions about current events or specific facts.
The
googleSearchRetrieval tool is maintained for backwards compatibility, but googleSearch is preferred.Code execution
ThecodeExecution tool allows Gemini to generate and run Python code to solve complex problems. The model writes the code, executes it, and returns the results.
contentBlocks field:
URL context
TheurlContext tool allows Gemini to fetch and use content from URLs to ground its responses.
Google Maps
ThegoogleMaps tool grounds responses with geospatial context from Google Maps. This is useful for place-related queries.
File search
ThefileSearch tool performs semantic retrieval from file search stores. Files must first be imported using the Gemini File API.
fileSearchStoreNames(required) — the names of the file search stores to retrieve frommetadataFilter(optional) — metadata filter to apply to the retrievaltopK(optional) — the number of semantic retrieval chunks to return
Computer use
ThecomputerUse tool enables Gemini to interact with a browser environment. The model can view screenshots and perform actions like clicking, typing, and scrolling.
environment(required) — the environment being operated (e.g."ENVIRONMENT_BROWSER")excludedPredefinedFunctions(optional) — predefined functions to exclude from the action space
MCP servers
ThemcpServers field allows Gemini to connect to remote MCP (Model Context Protocol) servers. Unlike other native tools, MCP servers are specified as an array on the tool object.
Vertex AI Search data store
If you are using Vertex AI (platformType: "gcp"), you can ground responses using a Vertex AI Search data store.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

