internal/mcp: add notifications

Add notification logic for intialization and list changes.

Change-Id: I1d392bb49d5995f2046c400da955a033ab2715ce
Reviewed-on: https://go-review.googlesource.com/c/tools/+/673775
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Jonathan Amsterdam 2025-05-17 12:59:45 -04:00
commit ce5b6cd926

View file

@ -120,8 +120,12 @@ var declarations = config{
"Prompt": {},
"PromptMessage": {},
"PromptArgument": {},
"ProgressToken": {Name: "-", Substitute: "any"}, // null|number|string
"RequestId": {Name: "-", Substitute: "any"}, // null|number|string
"PromptListChangedNotification": {
Name: "-",
Fields: config{"Params": {Name: "PromptListChangedParams"}},
},
"ProgressToken": {Name: "-", Substitute: "any"}, // null|number|string
"RequestId": {Name: "-", Substitute: "any"}, // null|number|string
"ReadResourceRequest": {
Name: "-",
Fields: config{"Params": {Name: "ReadResourceParams"}},
@ -130,8 +134,16 @@ var declarations = config{
Fields: config{"Contents": {Substitute: "*ResourceContents"}},
},
"Resource": {},
"Role": {},
"Root": {},
"ResourceListChangedNotification": {
Name: "-",
Fields: config{"Params": {Name: "ResourceListChangedParams"}},
},
"Role": {},
"Root": {},
"RootsListChangedNotification": {
Name: "-",
Fields: config{"Params": {Name: "RootsListChangedParams"}},
},
"SamplingCapabilities": {Substitute: "struct{}"},
"SamplingMessage": {},
@ -147,6 +159,10 @@ var declarations = config{
Fields: config{"InputSchema": {Substitute: "*jsonschema.Schema"}},
},
"ToolAnnotations": {},
"ToolListChangedNotification": {
Name: "-",
Fields: config{"Params": {Name: "ToolListChangedParams"}},
},
}
func main() {