spring-projects / spring-projects/spring-ai
add metadata in tool/list
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
Description
In mcp java sdk there is a meta filed, and I see that this doesn't seem to be implemented in SpringAI.
My scene is like this:
my project has many MCP tools, which will be passed every time when call the LLM. This will consume a lot of tokens, and it will cause confusion in the choice of LLM. So I hope to add some metadata to the MCP tool so that my MCP client can filter according to this metadata and then call the LLM.
I think the implementation might be like this, or there is an additional annotation
@Tool(metadata={"Type=RealTimeAnalysis"})
@Tool(metadata={"Type=HistoricalAnalysis"})
@ToolMeta({"Type=RealTimeAnalysis"})
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 linked mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java section around lines 1266-1276 to understand the MCP tool metadata shape, then trace how Spring AI registers tools and builds tool/list responses. Define how metadata is supplied and exposed so MCP clients can filter tools, and add or update tests for the resulting tool metadata.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100