internal/readme: fix server example (#63)
Fix an example using params.Name instead of params.Arguments.Name. All credit due to @A11Might for noticing this. Sending a separate PR to keep the internal/readme source consistent.
This commit is contained in:
parent
c47dbcd7b2
commit
8a3f272dbb
2 changed files with 2 additions and 2 deletions
|
|
@ -104,7 +104,7 @@ type HiParams struct {
|
||||||
|
|
||||||
func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[HiParams]) (*mcp.CallToolResultFor[any], error) {
|
func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[HiParams]) (*mcp.CallToolResultFor[any], error) {
|
||||||
return &mcp.CallToolResultFor[any]{
|
return &mcp.CallToolResultFor[any]{
|
||||||
Content: []mcp.Content{&mcp.TextContent{Text: "Hi " + params.Name}},
|
Content: []mcp.Content{&mcp.TextContent{Text: "Hi " + params.Arguments.Name}},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ type HiParams struct {
|
||||||
|
|
||||||
func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[HiParams]) (*mcp.CallToolResultFor[any], error) {
|
func SayHi(ctx context.Context, cc *mcp.ServerSession, params *mcp.CallToolParamsFor[HiParams]) (*mcp.CallToolResultFor[any], error) {
|
||||||
return &mcp.CallToolResultFor[any]{
|
return &mcp.CallToolResultFor[any]{
|
||||||
Content: []mcp.Content{&mcp.TextContent{Text: "Hi " + params.Name}},
|
Content: []mcp.Content{&mcp.TextContent{Text: "Hi " + params.Arguments.Name}},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue