Skip to content

Conversation

codeboyzhou
Copy link
Contributor

As the title described, this PR was created to solve issue #3805, please refer to the issue for more details.

@sunyuhan1998
Copy link
Contributor

Actually, @Tool was not originally designed specifically for MCP's tools. It is not an equivalent to McpSchema.Tool. The development of MCP has been too fast. I've noticed that we are trying to add more and more features to @Tool, attempting to bring it closer in functionality to McpSchema.Tool. I believe this is because we initially supported using @Tool to define tools on the MCP server side.

Perhaps we need a set of annotations such as @McpTool, @McpPrompt, and @McpResource, similar to what this project: https://github.com/spring-ai-community/mcp-annotations does. However, at this point, the project doesn't seem mature enough to be merged into Spring AI yet.

@sunyuhan1998
Copy link
Contributor

please sign off your commit to comply with the DCO

@codeboyzhou
Copy link
Contributor Author

Actually, @Tool was not originally designed specifically for MCP's tools. It is not an equivalent to McpSchema.Tool. The development of MCP has been too fast. I've noticed that we are trying to add more and more features to @Tool, attempting to bring it closer in functionality to McpSchema.Tool. I believe this is because we initially supported using @Tool to define tools on the MCP server side.

Perhaps we need a set of annotations such as @McpTool, @McpPrompt, and @McpResource, similar to what this project: https://github.com/spring-ai-community/mcp-annotations does. However, at this point, the project doesn't seem mature enough to be merged into Spring AI yet.

Oh I see, thanks for your patient explanation. That was also my confusion why there is no @Prompt and @Resource, you tell me the answer now.

By the way, for the annotations @McpTool, @McpPrompt, and @McpResource, I am a little familiar, but it's not due to spring-ai-community, actually I didn't know about this community, so I created a personal repository to do the things same like mcp-annotations months ago, just want to make my MCP exploration journey easier, because the native MCP Java SDK is a bit cumbersome to use, but after all, it's underlying implementation. I will learn about the project spring-ai-community/mcp-annotations you mentioned, thanks again.

- Add title field to DefaultToolDefinition and ToolDefinition interfaces
- Modify ToolDefinitions and ToolUtils to support new title field
- Adjust McpToolUtils to use title in tool specification

Signed-off-by: codeboyzhou <[email protected]>
@codeboyzhou codeboyzhou force-pushed the feat-add-title-for-tool-annotation branch from 833c169 to dafaad0 Compare July 14, 2025 05:42
@codeboyzhou
Copy link
Contributor Author

please sign off your commit to comply with the DCO

Thank you for the reminder. It's already done.

@ilayaperumalg ilayaperumalg added MCP enhancement New feature or request labels Jul 15, 2025
@tzolov
Copy link
Contributor

tzolov commented Sep 5, 2025

@codeboyzhou as pointed out above, the @Tool is not MCP specific tool annotation.

Starting with 1.1.0-SNAPSHOT we introduced the MCP annotations support for Spring AI including the @McpTool: https://docs.spring.io/spring-ai/reference/1.1-SNAPSHOT/api/mcp/mcp-annotations-overview.html
It is based on the mcp-annotations 0.3.0 community project that we intend to merge into spring-ai after M1.
So contribution to the mcp-annotations project adding title to the McpTool might be first step.
What do you think?

@codeboyzhou
Copy link
Contributor Author

@tzolov ok, I see. I will close this PR and the issue linked to it, also shift my attention to the mcp-annotations project.

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.

4 participants