Skip to content

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Sep 6, 2025

  • Introduce ToolContextToMcpMetaConverter interface for converting Spring AI ToolContext to MCP call metadata
  • Refactor McpToolCallbackAutoConfiguration to use ObjectProvider for flexible dependency injection
  • Remove automatic McpToolNamePrefixGenerator bean creation in favor of ObjectProvider-based resolution
  • Add builder pattern for AsyncMcpToolCallback and SyncMcpToolCallback with comprehensive configuration options
  • Add builder pattern for AsyncMcpToolCallbackProvider and SyncMcpToolCallbackProvider
  • Enhance tool callback call methods to support ToolContext parameter with metadata conversion
  • Update MCP tool callbacks to use new CallToolRequest.builder() API
  • Improve error handling and logging in tool callback implementations
  • Add comprehensive coverage for new builder functionality
  • Update documentation with ToolContextToMcpMetaConverter usage examples
  • Maintain backward compatibility through deprecation of old constructors

Breaking changes:

  • McpToolCallbackAutoConfiguration no longer automatically creates McpToolNamePrefixGenerator bean
  • Tool callback constructors are now private, use builder() method instead

Resolves: #3505
Resolves: #2868
Resolves: #2784
Resolves: #2620

Replaces: #3831

@tzolov tzolov added this to the 1.1.0.M1 milestone Sep 6, 2025
- Introduce ToolContextToMcpMetaConverter interface for converting Spring AI ToolContext to MCP call metadata
- Refactor McpToolCallbackAutoConfiguration to use ObjectProvider for flexible dependency injection
- Remove automatic McpToolNamePrefixGenerator bean creation in favor of ObjectProvider-based resolution
- Add builder pattern for AsyncMcpToolCallback and SyncMcpToolCallback with comprehensive configuration options
- Add builder pattern for AsyncMcpToolCallbackProvider and SyncMcpToolCallbackProvider
- Enhance tool callback call methods to support ToolContext parameter with metadata conversion
- Update MCP tool callbacks to use new CallToolRequest.builder() API
- Improve error handling and logging in tool callback implementations
- Add comprehensive coverage for new builder functionality
- Update documentation with ToolContextToMcpMetaConverter usage examples
- Maintain backward compatibility through deprecation of old constructors

Breaking changes:
- McpToolCallbackAutoConfiguration no longer automatically creates McpToolNamePrefixGenerator bean
- Tool callback constructors are now private, use builder() method instead

Resolves: spring-projects#3505
Resolves: spring-projects#2868
Resolves: spring-projects#2784
Resolves: spring-projects#2620

Replaces: spring-projects#3831

Signed-off-by: Christian Tzolov <[email protected]>
Co-authored-by: YunKui Lu <[email protected]>
@tzolov tzolov force-pushed the tool-context-to-mcp-meta-conversion branch from 010cae4 to 8576ebf Compare September 6, 2025 09:26
Signed-off-by: Christian Tzolov <[email protected]>
Co-authored-by: YunKui Lu <[email protected]>
@ilayaperumalg
Copy link
Member

LGTM

@ilayaperumalg
Copy link
Member

@YunKuiLu Thank you for the initial proposal to get this support and @tzolov thank you for refining the changes. Rebased, squashed and merged as e56eb12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants