mcp: fix some documentation (#41)
- Add some doc strings. - Remove markdown-like notations.
This commit is contained in:
parent
81eb55e6bc
commit
ff0d746521
1 changed files with 36 additions and 28 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue