@@ -25,6 +25,13 @@ func TestSSEMCPClient(t *testing.T) {
25
25
"test-tool" ,
26
26
mcp .WithDescription ("Test tool" ),
27
27
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
+ }),
28
35
), func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
29
36
return & mcp.CallToolResult {
30
37
Content : []mcp.Content {
@@ -95,10 +102,21 @@ func TestSSEMCPClient(t *testing.T) {
95
102
96
103
// Test ListTools
97
104
toolsRequest := mcp.ListToolsRequest {}
98
- _ , err = client .ListTools (ctx , toolsRequest )
105
+ toolListResult , err : = client .ListTools (ctx , toolsRequest )
99
106
if err != nil {
100
107
t .Errorf ("ListTools failed: %v" , err )
101
108
}
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
+ }
102
120
})
103
121
104
122
// t.Run("Can handle notifications", func(t *testing.T) {
0 commit comments