spring-projects / spring-projects/spring-ai
Enhance Tool Calling with Parameter Binding and Authentication Support
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
The current Spring AI tool calling mechanism (as documented here) is a powerful way to extend the capabilities of AI models by allowing them to interact with external APIs and services.
However, there are two key features currently missing that would significantly improve the security, flexibility, and usability of tool calling:
- Parameter Binding: The ability to pre-define or "bind" values to specific tool parameters before the model has a chance to interact with them.
- Authentication: A standardized way to securely authenticate tool calls, especially when those tools access sensitive data or require user-specific authorization.
Expected Behavior
- Non-Breaking Changes: The proposed additions should not require changes to existing core interfaces like ChatClient, ChatModel, or ToolCallingManager.
- Extensibility: The design should be flexible enough to accommodate different authentication mechanisms (OAuth, API keys, etc.) and custom parameter binding logic.
- Ease of Use: The API should be intuitive and easy to use for developers defining and calling tools.
- Consistency: The implementation should align with existing Spring AI design principles and coding style.
- Security: Sensitive information (e.g., API keys) should never be exposed to the LLM.
- Correct Schema Handling: Parameter binding must correctly modify the JSON schema presented to the LLM, preventing it from attempting to provide values for already-bound parameters.
- Tool Context Integration: Authentication should leverage the existing ToolContext mechanism for passing data to tools.
Drawing inspiration from the toolbox-langchain Python SDK (link to toolbox-langchain SDK documentation). The goal is to make Spring AI's tool calling more robust, secure, and suitable for production environments.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Spring AI's documented tool-calling API and the existing ToolContext mechanism, then compare the referenced toolbox_langchain tools.py implementation. Define how parameter binding changes the schema seen by the model and how authentication data reaches tools without exposing secrets; done means a non-breaking, extensible design covering both behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, authentication, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100