spring-projects / spring-projects/spring-ai
@JsonUnwrapped-like annotation for @McpTool parameters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Expected Behavior
It would be nice to be able to define a dedicated type for a MCP tool's parameter parameter and use a @JsonUnwrapped-like annotation on it so that it's included directly in the request.
Current Behavior
I have to manually repeat the @McpToolParam annotation each time I use the shared parameter.
Context
I have several MCP parameters that have meaningful descriptions and are used in many tools. Unfortunately, I have to manually repeat the @McpToolParam annotation each time. It would be nice to be able to define a dedicated type for this parameter and use a @JsonUnwrapped-like annotation on it so that it's included directly in the request.
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 handling of @McpTool and @McpToolParam parameters, then examine how reusable parameter types are represented in the generated request. Done means a dedicated type can be included with a JsonUnwrapped-like annotation, preserving its descriptions without repeating @McpToolParam at every use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100