Skip to content

Add name attribute to McpToolParam#6556

Open
jialiuyang wants to merge 1 commit into
spring-projects:mainfrom
jialiuyang:feat/mcptoolparam-name-attribute
Open

Add name attribute to McpToolParam#6556
jialiuyang wants to merge 1 commit into
spring-projects:mainfrom
jialiuyang:feat/mcptoolparam-name-attribute

Conversation

@jialiuyang

Copy link
Copy Markdown

MCP tool input schemas and runtime argument binding always used the Java reflection parameter name, so callers could not expose snake_case or other external naming conventions while keeping idiomatic camelCase parameter names in tool methods.

This adds an optional name attribute to McpToolParam and uses it when generating top-level tool input schemas and when resolving incoming tool arguments. Nested object fields annotated with McpToolParam also honour the custom name through the schema module property resolver.

Fixes #6544

Thank you for taking time to contribute this pull request!
You might have already read the contributor guide, but as a reminder, please make sure to:

  • Add a Signed-off-by line to each commit (git commit -s) per the DCO
  • Rebase your changes on the latest main branch and squash your commits
  • Add/Update unit tests as needed
  • Run a build and make sure all tests pass prior to submission

For more details, please check the contributor guide.
Thank you upfront!

MCP tool input schemas and runtime argument binding always used the
Java reflection parameter name, so callers could not expose snake_case
or other external naming conventions while keeping idiomatic camelCase
parameter names in tool methods.

This adds an optional name attribute to McpToolParam and uses it when
generating top-level tool input schemas and when resolving incoming
tool arguments. Nested object fields annotated with McpToolParam also
honour the custom name through the schema module property resolver.

Fixes spring-projects#6544

Signed-off-by: jialiuyang <495120021@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add name attribute to @McpToolParam for custom MCP tool argument names

2 participants