# Class FunctionTool<TParameters>

The base class for all tools.

#### Type Parameters

- TParameters extends ToolInputParameters = undefined

#### Hierarchy (View Summary)

- BaseTool
  - FunctionTool
    - LongRunningFunctionTool

- Defined in tools/function_tool.ts:95

## Constructors

### constructor

- new FunctionTool<TParameters extends ToolInputParameters = undefined>(
  options: ToolOptions<TParameters>,
  ): FunctionTool<TParameters>

  The constructor acts as the user-friendly factory.

  #### Type Parameters

  - TParameters extends ToolInputParameters = undefined

  #### Parameters

  - options: ToolOptions<TParameters>

    The configuration for the tool.

  #### Returns FunctionTool<TParameters>

  Overrides BaseTool.constructor

  - Defined in tools/function_tool.ts:110

## Properties

### `Readonly`[BASE_TOOL_SIGNATURE_SYMBOL]

"[BASE_TOOL_SIGNATURE_SYMBOL]": true

A unique symbol to identify ADK base tool class.

Inherited from BaseTool.[BASE_TOOL_SIGNATURE_SYMBOL]

- Defined in tools/base_tool.ts:64

### `Readonly`[FUNCTION_TOOL_SIGNATURE_SYMBOL]

"[FUNCTION_TOOL_SIGNATURE_SYMBOL]": true

A unique symbol to identify ADK function tool class.

- Defined in tools/function_tool.ts:99

### `Readonly` description

description: string

Inherited from BaseTool.description

- Defined in tools/base_tool.ts:67

### `Readonly` isLongRunning

isLongRunning: boolean

Inherited from BaseTool.isLongRunning

- Defined in tools/base_tool.ts:68

### `Readonly` name

name: string

Inherited from BaseTool.name

- Defined in tools/base_tool.ts:66

## Accessors

### apiVariant

- get apiVariant(): GoogleLLMVariant

  The Google API LLM variant to use.

  #### Returns GoogleLLMVariant

  Inherited from BaseTool.apiVariant

  - Defined in tools/base_tool.ts:151

## Methods

### _getDeclaration

- _getDeclaration(): FunctionDeclaration

  Provide a schema for the function.

  #### Returns FunctionDeclaration

  Overrides BaseTool._getDeclaration

  - Defined in tools/function_tool.ts:129

### processLlmRequest

- processLlmRequest(request: ToolProcessLlmRequest): Promise<void>

  Processes the outgoing LLM request for this tool.

  Use cases:

  - Most common use case is adding this tool to the LLM request.
  - Some tools may just preprocess the LLM request before it's sent out.

  #### Parameters

  - request: ToolProcessLlmRequest

    The request to process the LLM request.

  #### Returns Promise<void>

  Inherited from BaseTool.processLlmRequest

  - Defined in tools/base_tool.ts:120

### runAsync

- runAsync(req: RunAsyncToolRequest): Promise<unknown>

  Logic for running the tool.

  #### Parameters

  - req: RunAsyncToolRequest

  #### Returns Promise<unknown>

  Overrides BaseTool.runAsync

  - Defined in tools/function_tool.ts:140