internal/mcp: change function signatures match design doc

To ensure backward compatibility, every method in the spec now takes a
*Params struct and returns a *Result struct.

CallTools is an exception: we'll change that in the next CL.

Change-Id: I58835239c67582401b8c9c2d070702d270131c08
Reviewed-on: https://go-review.googlesource.com/c/tools/+/672595
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Jonathan Amsterdam 2025-05-14 05:50:50 -04:00
commit 4721f501df

View file

@ -97,11 +97,15 @@ var declarations = config{
Fields: config{"Params": {Name: "ListToolsParams"}},
},
"ListToolsResult": {},
"Prompt": {},
"PromptMessage": {},
"PromptArgument": {},
"ProgressToken": {Name: "-", Substitute: "any"}, // null|number|string
"RequestId": {Name: "-", Substitute: "any"}, // null|number|string
"PingRequest": {
Name: "-",
Fields: config{"Params": {Name: "PingParams"}},
},
"Prompt": {},
"PromptMessage": {},
"PromptArgument": {},
"ProgressToken": {Name: "-", Substitute: "any"}, // null|number|string
"RequestId": {Name: "-", Substitute: "any"}, // null|number|string
"ReadResourceRequest": {
Name: "-",
Fields: config{"Params": {Name: "ReadResourceParams"}},