spring-projects / spring-projects/spring-ai
dynamic tool loading
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Hello,
i have explored a bit the dynamic tool example but it seems that tool are like a "global" concept where i can add and remove tool based on "something".
So if i understand correctly the usage is rather limited, as i can basically enable or disable a tool based on a certain condition, but not on who is executing the call.
Now, if i have a user that connect with a oauth set of grant, it will be cool to filter the tool based on his role/permission set.
At the moment what happen is that i have 2 tool
toolA -> all
toolB -> user with a specific grant
when user a user not form group B connect, he can ask the question that trigger the tool and then get an exception "you can't use tool b". wouldn't be better to disable the tool so the agent don't even try to invoke it? save token, allow fallback for other tool/agent_logic to be executed?
Another option is to split mcp server based on the "grant" but seems a lot of 'partitioning' that sometimes isn't even necessary and create duplication (Same request model, same db, some logic etc etc)
Apologize for my english, hope my suggestion is clear enough (reasonable or not, it's another matter)
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 the dynamic tool example and trace how tools are registered and made available during a request. Then examine how the caller's OAuth grants or permissions could be exposed to that decision; done means defining and validating a per-user tool-visibility approach that avoids unauthorized tool invocation and preserves fallback behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai, authorization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100