Variable: tools
@providerprotocol/ai / google / tools
Variable: tools
Section titled “Variable: tools”
consttools:object
Defined in: src/providers/google/types.ts:960
Namespace object containing all Google tool helper constructors.
Provides a convenient way to create built-in tool configurations.
Type Declaration
Section titled “Type Declaration”codeExecution()
Section titled “codeExecution()”codeExecution: () =>
GoogleCodeExecutionTool=codeExecutionTool
Creates a code execution tool configuration
Creates a code execution tool configuration.
Enables Gemini to write and execute Python code in a sandbox.
Returns
Section titled “Returns”A code execution tool configuration object
Example
Section titled “Example”const codeExec = codeExecutionTool();fileSearch()
Section titled “fileSearch()”fileSearch: (
options) =>GoogleFileSearchTool=fileSearchTool
Creates a file search (RAG) tool configuration
Creates a file search (RAG) tool configuration.
Enables Gemini to search through uploaded documents.
Note: Cannot be combined with other built-in tools.
Parameters
Section titled “Parameters”options
Section titled “options”File search configuration
fileSearchStoreNames
Section titled “fileSearchStoreNames”string[]
metadataFilter?
Section titled “metadataFilter?”string
Returns
Section titled “Returns”A file search tool configuration object
Example
Section titled “Example”const fileSearch = fileSearchTool({ fileSearchStoreNames: ['fileSearchStores/abc123'],});googleMaps()
Section titled “googleMaps()”googleMaps: (
options?) =>GoogleMapsTool=googleMapsTool
Creates a Google Maps grounding tool configuration
Creates a Google Maps grounding tool configuration.
Enables Gemini to search for places using Google Maps data.
Note: Not supported in Gemini 3 models.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional configuration
enableWidget?
Section titled “enableWidget?”boolean
Returns
Section titled “Returns”A Google Maps tool configuration object
Example
Section titled “Example”const maps = googleMapsTool();
// With widget enabledconst mapsWithWidget = googleMapsTool({ enableWidget: true });googleSearch()
Section titled “googleSearch()”googleSearch: () =>
GoogleSearchTool=googleSearchTool
Creates a Google Search grounding tool configuration
Creates a Google Search grounding tool configuration.
Enables Gemini to search the web using Google Search for up-to-date information.
Returns
Section titled “Returns”A Google Search tool configuration object
Example
Section titled “Example”const search = googleSearchTool();urlContext()
Section titled “urlContext()”urlContext: () =>
GoogleUrlContextTool=urlContextTool
Creates a URL context tool configuration
Creates a URL context tool configuration.
Enables Gemini to fetch and analyze content from URLs.
Returns
Section titled “Returns”A URL context tool configuration object
Example
Section titled “Example”const urlCtx = urlContextTool();Example
Section titled “Example”import { google, tools } from 'provider-protocol/google';
const model = llm({ model: google('gemini-2.5-flash'), params: { tools: [ tools.googleSearch(), tools.codeExecution(), ], },});