spring-projects / spring-projects/spring-ai

@JsonUnwrapped-like annotation for @McpTool parameters

Open
#4,486 0 comments 1 reaction 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 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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.