so important feature ,why not support...
Comment From: SightStudio
I don't know what this mean.
I'm already using ToolContext data in mcp tools in my local mcp server
Comment From: tzolov
@Laggar, Spring AI MCP integration supports ToolContext.
Additionally, when you add a ToolContext parameter to your tool method, it contains an McpSyncServerExchange instance under the exchange key.
Access it with McpToolUtils.getMcpExchange(toolContext) to use logging, sampling, etc.
See this example showing exchange.loggingNotification(...) and exchange.createMessage(...).
We need to update our docs to explain these capabilities. I'll keep this issue open until then.
Comment From: dami-px
@tzolov I am still unable to access any data I set as context from the server. Example:
val options = ToolCallingChatOptions.builder()
.toolCallbacks(*toolCallbacks)
.toolContext(mapOf("userId" to getUserId))
.build()
And on the server, I only see the mcp client information in the exchange key. Am I missing something?
Comment From: Tom-Clear
@tzolov When calling the mcp server, I hope to pass the toolContext,What should I do in this situation?