Skip to content

Commit 9355543

Browse files
Update SyncMcpToolCallback.java
Add getOriginalToolName method for AsyncMcpToolCallback in order to get easy access to the 'original' toolname before the prefix was added Signed-off-by: shishuiwuhen2009 <[email protected]>
1 parent d67a3cd commit 9355543

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mcp/common/src/main/java/org/springframework/ai/mcp/SyncMcpToolCallback.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ public ToolDefinition getToolDefinition() {
100100
.build();
101101
}
102102

103+
/**
104+
* get tool name
105+
* @return the tool's name
106+
*/
107+
public String getOriginalToolName() {
108+
return this.tool.name();
109+
}
110+
103111
/**
104112
* Executes the tool with the provided input.
105113
* <p>

0 commit comments

Comments
 (0)