spring-projects / spring-projects/spring-ai

add metadata in tool/list

Open
#4,743 5 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.