Skip to content

GH-6206: Update tool callback guidance#6214

Open
YunKuiLu wants to merge 1 commit into
spring-projects:mainfrom
YunKuiLu:gh-6206-tool-callback-guidance
Open

GH-6206: Update tool callback guidance#6214
YunKuiLu wants to merge 1 commit into
spring-projects:mainfrom
YunKuiLu:gh-6206-tool-callback-guidance

Conversation

@YunKuiLu
Copy link
Copy Markdown
Contributor

@YunKuiLu YunKuiLu commented May 30, 2026

Summary

I'm not sure whether the maintainers want to add tools(ToolCallback...) and tools(ToolCallbackProvider...) overloads. This PR does not add those APIs. Instead, it updates the exception message and documentation examples that currently point users toward deprecated or incorrect usage.

Changes

  • Update the MethodToolCallbackProvider exception message to suggest using tools(toolSpec -> toolSpec.callbacks(...)) instead of passing callbacks/providers directly to tools(...).
  • Update MCP and tool migration documentation examples to pass ToolCallback and ToolCallbackProvider instances through callbacks(...).
  • Fix a ToolCallingChatOptions example that passed an @Tool object directly to toolCallbacks(...) by converting it with ToolCallbacks.from(...).

Tests

  • ./mvnw -pl spring-ai-model -Dtest=MethodToolCallbackProviderTests test

Related #6206

Signed-off-by: YunKui Lu <luyunkui95@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant