Package org.springframework.ai.tool
Interface ToolCallback
- All Known Implementing Classes:
AsyncMcpToolCallback
,FunctionToolCallback
,MethodToolCallback
,SyncMcpToolCallback
public interface ToolCallback
Represents a tool whose execution can be triggered by an AI model.
- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Method Summary
Modifier and TypeMethodDescriptionExecute tool with the given input and return the result to send back to the AI model.default String
call
(String toolInput, ToolContext tooContext) Execute tool with the given input and context, and return the result to send back to the AI model.Definition used by the AI model to determine when and how to call the tool.default ToolMetadata
Metadata providing additional information on how to handle the tool.
-
Method Details
-
getToolDefinition
ToolDefinition getToolDefinition()Definition used by the AI model to determine when and how to call the tool. -
getToolMetadata
Metadata providing additional information on how to handle the tool. -
call
Execute tool with the given input and return the result to send back to the AI model. -
call
Execute tool with the given input and context, and return the result to send back to the AI model.
-