mcp: align PromptHandler args with other handlers (#348)

The second arg is a GetPromptRequest.

Fixes #300.
This commit is contained in:
Jonathan Amsterdam 2025-08-22 10:44:05 -04:00 • committed by GitHub
commit e3e8aaf024
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,11 +30,11 @@ func SayHi(ctx context.Context, req *mcp.CallToolRequest, args HiArgs) (*mcp.Cal
}, nil, nil
}
func PromptHi(ctx context.Context, ss *mcp.ServerSession, params *mcp.GetPromptParams) (*mcp.GetPromptResult, error) {
func PromptHi(ctx context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error) {
return &mcp.GetPromptResult{
Description: "Code review prompt",
Messages: []*mcp.PromptMessage{
{Role: "user", Content: &mcp.TextContent{Text: "Say hi to " + params.Arguments["name"]}},
{Role: "user", Content: &mcp.TextContent{Text: "Say hi to " + req.Params.Arguments["name"]}},
},
}, nil
}