@@ -25,6 +25,13 @@ func TestSSEMCPClient(t *testing.T) {
2525		"test-tool" ,
2626		mcp .WithDescription ("Test tool" ),
2727		mcp .WithString ("parameter-1" , mcp .Description ("A string tool parameter" )),
28+ 		mcp .WithToolAnnotation (mcp.ToolAnnotation {
29+ 			Title :           "Test Tool Annotation Title" ,
30+ 			ReadOnlyHint :    true ,
31+ 			DestructiveHint : false ,
32+ 			IdempotentHint :  true ,
33+ 			OpenWorldHint :   false ,
34+ 		}),
2835	), func (ctx  context.Context , request  mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
2936		return  & mcp.CallToolResult {
3037			Content : []mcp.Content {
@@ -95,10 +102,21 @@ func TestSSEMCPClient(t *testing.T) {
95102
96103		// Test ListTools 
97104		toolsRequest  :=  mcp.ListToolsRequest {}
98- 		_ , err  =  client .ListTools (ctx , toolsRequest )
105+ 		toolListResult , err  : =client .ListTools (ctx , toolsRequest )
99106		if  err  !=  nil  {
100107			t .Errorf ("ListTools failed: %v" , err )
101108		}
109+ 		if  toolListResult  ==  nil  ||  len ((* toolListResult ).Tools ) ==  0  {
110+ 			t .Errorf ("Expected one tool" )
111+ 		}
112+ 		testToolAnnotations  :=  (* toolListResult ).Tools [0 ].Annotations 
113+ 		if  testToolAnnotations .Title  !=  "Test Tool Annotation Title"  || 
114+ 			testToolAnnotations .ReadOnlyHint  !=  true  || 
115+ 			testToolAnnotations .DestructiveHint  !=  false  || 
116+ 			testToolAnnotations .IdempotentHint  !=  true  || 
117+ 			testToolAnnotations .OpenWorldHint  !=  false  {
118+ 			t .Errorf ("The annotations of the tools are invalid" )
119+ 		}
102120	})
103121
104122	// t.Run("Can handle notifications", func(t *testing.T) { 
0 commit comments