spring-projects / spring-projects/spring-ai

dynamic tool loading

Open
#4,401 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: feedback-provided
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.