Skip to content

Variable: tools

@providerprotocol/ai


@providerprotocol/ai / google / tools

const tools: 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.

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.

GoogleCodeExecutionTool

A code execution tool configuration object

const codeExec = codeExecutionTool();

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.

File search configuration

string[]

string

GoogleFileSearchTool

A file search tool configuration object

const fileSearch = fileSearchTool({
fileSearchStoreNames: ['fileSearchStores/abc123'],
});

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.

Optional configuration

boolean

GoogleMapsTool

A Google Maps tool configuration object

const maps = googleMapsTool();
// With widget enabled
const mapsWithWidget = googleMapsTool({ enableWidget: true });

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.

GoogleSearchTool

A Google Search tool configuration object

const search = googleSearchTool();

urlContext: () => GoogleUrlContextTool = urlContextTool

Creates a URL context tool configuration

Creates a URL context tool configuration.

Enables Gemini to fetch and analyze content from URLs.

GoogleUrlContextTool

A URL context tool configuration object

const urlCtx = urlContextTool();
import { google, tools } from 'provider-protocol/google';
const model = llm({
model: google('gemini-2.5-flash'),
params: {
tools: [
tools.googleSearch(),
tools.codeExecution(),
],
},
});