# AgentTool

class AgentTool(val agent: BaseAgent, val skipSummarization: Boolean = false) : BaseTool

A tool that wraps a BaseAgent.

This tool allows an agent to be called as a tool within a larger application. The agent's input schema is used to define the tool's input parameters, and the agent's output is returned as the tool's result.

## Constructors

AgentTool
Link copied to clipboard
constructor(agent: BaseAgent, skipSummarization: Boolean = false)

## Types

Companion
Link copied to clipboard
object Companion

## Properties

agent
Link copied to clipboard
val agent: BaseAgent

The agent to wrap.

customMetadata
Link copied to clipboard
val customMetadata: Map<String, Any>

The custom metadata of the tool.

description
Link copied to clipboard
val description: String

The description of the tool.

isLongRunning
Link copied to clipboard
val isLongRunning: Boolean = false

Whether the tool's final result will be delivered out-of-band. When `true`, the framework marks the call as long-running and uses the tool's return value as the function-response payload (or suppresses the response entirely if the tool returns `Unit`).

name
Link copied to clipboard
val name: String

The name of the tool.

skipSummarization
Link copied to clipboard
val skipSummarization: Boolean = false

Whether to skip summarization of the agent output in the parent agent.

## Functions

close
Link copied to clipboard
open override fun close()
declaration
Link copied to clipboard
open override fun declaration(): FunctionDeclaration

Returns the underlying function declaration.

processLlmRequest
Link copied to clipboard
open suspend fun processLlmRequest(toolContext: ToolContext, llmRequest: LlmRequest): LlmRequest

Processes the LLM request before it is sent.

run
Link copied to clipboard
open suspend override fun run(context: ToolContext, args: Map<String, Any>): String

Executes the tool.