Uses of Class
org.springframework.ai.chat.model.ToolContext
Packages that use ToolContext
Package
Description
Core support for Model Context Protocol (MCP) integration in Spring AI.
Support for MCP servers implementing the 2026-07-28 ("modern") specification revision,
built on the
io.modelcontextprotocol.modern server API of the MCP Java SDK.Tool Search Tool API: core interface and model types for dynamic tool discovery.
-
Uses of ToolContext in org.springframework.ai.mcp
Methods in org.springframework.ai.mcp with parameters of type ToolContextModifier and TypeMethodDescriptionAsyncMcpToolCallback.call(String toolCallInput, @Nullable ToolContext toolContext) SyncMcpToolCallback.call(String toolCallInput, @Nullable ToolContext toolContext) ToolContextToMcpMetaConverter.convert(ToolContext toolContext) Convert the givenToolContextto a Map<String, Object> as MCP tool call metadata.static Optional<io.modelcontextprotocol.server.McpSyncServerExchange>McpToolUtils.getMcpExchange(ToolContext toolContext) Retrieves the MCP exchange object from the provided tool context if it exists. -
Uses of ToolContext in org.springframework.ai.mcp.modern
Methods in org.springframework.ai.mcp.modern with parameters of type ToolContextModifier and TypeMethodDescriptionstatic @Nullable io.modelcontextprotocol.modern.server.McpRequestContextMcpModernToolUtils.getMcpRequestContext(@Nullable ToolContext toolContext) Retrieves theMcpRequestContextof the current tool call from theToolContext, if the callback is being invoked by a modern MCP server. -
Uses of ToolContext in org.springframework.ai.tool
Methods in org.springframework.ai.tool with parameters of type ToolContextModifier and TypeMethodDescriptiondefault StringToolCallback.call(String toolInput, @Nullable ToolContext toolContext) Execute tool with the given input and context, and return the result to send back to the AI model. -
Uses of ToolContext in org.springframework.ai.tool.augment
Methods in org.springframework.ai.tool.augment with parameters of type ToolContextModifier and TypeMethodDescriptionAugmentedToolCallback.call(String toolInput, @Nullable ToolContext tooContext) -
Uses of ToolContext in org.springframework.ai.tool.function
Methods in org.springframework.ai.tool.function with parameters of type ToolContextModifier and TypeMethodDescriptionFunctionToolCallback.call(String toolInput, @Nullable ToolContext toolContext) Method parameters in org.springframework.ai.tool.function with type arguments of type ToolContextModifier and TypeMethodDescriptionstatic <I,O> FunctionToolCallback.Builder<I, O> FunctionToolCallback.builder(String name, BiFunction<@Nullable I, @Nullable ToolContext, O> function) Build aFunctionToolCallbackfrom aBiFunction.Constructor parameters in org.springframework.ai.tool.function with type arguments of type ToolContextModifierConstructorDescriptionFunctionToolCallback(ToolDefinition toolDefinition, @Nullable ToolMetadata toolMetadata, Type toolInputType, BiFunction<@Nullable I, @Nullable ToolContext, O> toolFunction, @Nullable ToolCallResultConverter toolCallResultConverter) -
Uses of ToolContext in org.springframework.ai.tool.method
Methods in org.springframework.ai.tool.method with parameters of type ToolContextModifier and TypeMethodDescriptionMethodToolCallback.call(String toolInput, @Nullable ToolContext toolContext) -
Uses of ToolContext in org.springframework.ai.tool.toolsearch
Methods in org.springframework.ai.tool.toolsearch with parameters of type ToolContextModifier and TypeMethodDescriptionToolSearchTool.toolSearchTool(String query, Integer maxResults, String categoryFilter, ToolContext toolContext)