Skip to content

Commit f4777bd

Browse files
Fix tool result in examples
1 parent 09181c2 commit f4777bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/hello/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type HiArgs struct {
2525
func SayHi(ctx context.Context, ss *mcp.ServerSession, params *mcp.CallToolParamsFor[HiArgs]) (*mcp.CallToolResultFor[struct{}], error) {
2626
return &mcp.CallToolResultFor[struct{}]{
2727
Content: []mcp.Content{
28-
&mcp.TextContent{Text: "Hi " + params.Name},
28+
&mcp.TextContent{Text: "Hi " + params.Arguments.Name},
2929
},
3030
}, nil
3131
}

examples/sse/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type SayHiParams struct {
2222
func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[SayHiParams]) (*mcp.CallToolResultFor[any], error) {
2323
return &mcp.CallToolResultFor[any]{
2424
Content: []mcp.Content{
25-
&mcp.TextContent{Text: "Hi " + params.Name},
25+
&mcp.TextContent{Text: "Hi " + params.Arguments.Name},
2626
},
2727
}, nil
2828
}

0 commit comments

Comments
 (0)