Skip to content

Commit d044bd7

Browse files
committed
fix README
1 parent 1373ddf commit d044bd7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ func main() {
7171
log.Fatal("tool failed")
7272
}
7373
for _, c := range res.Content {
74-
log.Print(c.Text)
74+
if t, ok := c.(*mcp.TextContent); ok {
75+
log.Print(t.Text)
76+
}
7577
}
7678
}
7779
```
@@ -94,8 +96,10 @@ type HiParams struct {
9496
}
9597

9698
func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[HiParams]) (*mcp.CallToolResultFor[any], error) {
97-
return &mcp.CallToolResultFor[any]{
98-
Content: []*mcp.ContentBlock{mcp.NewTextContent("Hi " + params.Name)},
99+
return &mcp.CallToolResultFor[any]{
100+
Content: []mcp.Content{
101+
&mcp.TextContent{Text: "Hi " + params.Name},
102+
},
99103
}, nil
100104
}
101105

0 commit comments

Comments
 (0)