Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func main() {
log.Fatal("tool failed")
}
for _, c := range res.Content {
log.Print(c.Text)
if t, ok := c.(*mcp.TextContent); ok {
log.Print(t.Text)
}
}
}
```
Expand All @@ -95,7 +97,9 @@ type HiParams struct {

func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[HiParams]) (*mcp.CallToolResultFor[any], error) {
return &mcp.CallToolResultFor[any]{
Content: []*mcp.ContentBlock{mcp.NewTextContent("Hi " + params.Name)},
Content: []mcp.Content{
&mcp.TextContent{Text: "Hi " + params.Name},
},
}, nil
}

Expand Down
Loading