spring-projects / spring-projects/spring-ai
I Hope @Tool Support DescriptionFactory Config,To Solution Dynamic description Scene
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.
Expected Behavior
我在编写MCP的时候,我希望Tool注解中,可以动态去读取一些外部的数据,从而拼接出一个动态的tool注解描述中的提示词,这样提示词中也会包含一些关键的元素、或者基础配置,这样AI在生成参数的时候,不需要在额外调用接口,避免让MCP客户端发送多次请求获取一些依赖的基础的公共配置参数。
Current Behavior
当前Java中的@Tool注解仅支持静态配置的description字段。不能动态拼接
Context
我希望当前@Tool 注解、@ToolParam注解可以提供一个descriptionFactory的字段,这样外部开发者可以配置实现的具体逻辑,然后工具描述可以更灵活的控制和组装一些丰富的参数,从而某些情况下不需要客户端多次调用接口。
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 by locating the @Tool and @ToolParam annotation definitions and the code that reads their static description fields. Review how tool descriptions are assembled for MCP, then determine how a configurable descriptionFactory could supply dynamic content and how completion would be verified for both annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100