mcp: rename mcp{Params,Result} to is{Params,Result} (#270)

For some reason, when making these marker methods, the standard naming
convention escaped me.
This commit is contained in:
Robert Findley 2025-08-09 11:06:59 -04:00 • committed by GitHub
commit 4e413da771
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -337,8 +337,8 @@ func setProgressToken(p Params, pt any) {
// Params is a parameter (input) type for an MCP call or notification.
type Params interface {
// mcpParams discourages implementation of Params outside of this package.
mcpParams()
// isParams discourages implementation of Params outside of this package.
isParams()
// GetMeta returns metadata from a value.
GetMeta() map[string]any
@ -361,8 +361,8 @@ type RequestParams interface {
// Result is a result of an MCP call.
type Result interface {
// mcpResult discourages implementation of Result outside of this package.
mcpResult()
// isResult discourages implementation of Result outside of this package.
isResult()
// GetMeta returns metadata from a value.
GetMeta() map[string]any
@ -374,7 +374,7 @@ type Result interface {
// Those methods cannot return nil, because jsonrpc2 cannot handle nils.
type emptyResult struct{}
func (*emptyResult) mcpResult() {}
func (*emptyResult) isResult() {}
func (*emptyResult) GetMeta() map[string]any { panic("should never be called") }
func (*emptyResult) SetMeta(map[string]any) { panic("should never be called") }