mcp: fix some documentation (#41)

- Add some doc strings.

- Remove markdown-like notations.
This commit is contained in:
Jonathan Amsterdam 2025-06-25 17:38:37 -04:00 • committed by GitHub
commit ff0d746521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -236,9 +236,13 @@ func notifySessions[S Session](sessions []S, method string, params Params) {
}
}
// Meta is additional metadata for requests, responses and other types.
type Meta map[string]any
func (m Meta) GetMeta() map[string]any { return m }
// GetMeta returns metadata from a value.
func (m Meta) GetMeta() map[string]any { return m }
// SetMeta sets the metadata on a value.
func (m *Meta) SetMeta(x map[string]any) { *m = x }
const progressTokenKey = "progressToken"
@ -263,7 +267,9 @@ func setProgressToken(p Params, pt any) {
// Params is a parameter (input) type for an MCP call or notification.
type Params interface {
// GetMeta returns metadata from a value.
GetMeta() map[string]any
// SetMeta sets the metadata on a value.
SetMeta(map[string]any)
}
@ -282,7 +288,9 @@ type RequestParams interface {
// Result is a result of an MCP call.
type Result interface {
// GetMeta returns metadata from a value.
GetMeta() map[string]any
// SetMeta sets the metadata on a value.
SetMeta(map[string]any)
}