@@ -48,27 +48,6 @@ class AsyncMcpToolCallbackTest {
4848 @ Mock
4949 private McpSchema .Tool tool ;
5050
51- @ Test
52- void getToolDefinitionShouldReturnCorrectDefinition () {
53-
54- var clientInfo = new McpSchema .Implementation ("testClient" , "1.0.0" );
55- var toolAnnotations = new McpSchema .ToolAnnotations (null , false , false , false , false , true );
56-
57- when (this .mcpClient .getClientInfo ()).thenReturn (clientInfo );
58- when (this .tool .name ()).thenReturn ("testTool" );
59- when (this .tool .description ()).thenReturn ("Test tool description" );
60- when (this .tool .annotations ()).thenReturn (toolAnnotations );
61-
62- AsyncMcpToolCallback callback = new AsyncMcpToolCallback (this .mcpClient , this .tool );
63-
64- var toolDefinition = callback .getToolDefinition ();
65- var toolMetadata = callback .getToolMetadata ();
66-
67- assertThat (toolDefinition .name ()).isEqualTo (clientInfo .name () + "_testTool" );
68- assertThat (toolDefinition .description ()).isEqualTo ("Test tool description" );
69- assertThat (toolMetadata .returnDirect ()).isEqualTo (true );
70- }
71-
7251 @ Test
7352 void callShouldThrowOnError () {
7453 when (this .tool .name ()).thenReturn ("testTool" );
@@ -225,6 +204,8 @@ void getToolDefinitionShouldReturnCorrectDefinition() {
225204 when (this .tool .description ()).thenReturn ("Test tool description" );
226205 var jsonSchema = mock (McpSchema .JsonSchema .class );
227206 when (this .tool .inputSchema ()).thenReturn (jsonSchema );
207+ var toolAnnotations = new McpSchema .ToolAnnotations (null , false , false , false , false , true );
208+ when (this .tool .annotations ()).thenReturn (toolAnnotations );
228209
229210 // Act
230211 var callback = AsyncMcpToolCallback .builder ()
@@ -234,11 +215,13 @@ void getToolDefinitionShouldReturnCorrectDefinition() {
234215 .build ();
235216
236217 ToolDefinition definition = callback .getToolDefinition ();
218+ var toolMetadata = callback .getToolMetadata ();
237219
238220 // Assert
239221 assertThat (definition .name ()).isEqualTo ("prefix_testTool" );
240222 assertThat (definition .description ()).isEqualTo ("Test tool description" );
241223 assertThat (definition .inputSchema ()).isNotNull ();
224+ assertThat (toolMetadata .returnDirect ()).isEqualTo (true );
242225 }
243226
244227 @ Test
0 commit comments