mcp,design: revert 'content' back to an interface type (#29)
After some experience with the flattened version of Content, we see that it can easily lead to incorrect usage and is a harder API to read. Therefore, this CL changes back to a design similar to what we had prior to https://go.dev/cl/672415, though opting to promote content unmarshalling to the protocol types that use it, which leads to an overall simpler api.
This commit is contained in:
parent
d6ea827820
commit
204b59483b
5 changed files with 333 additions and 159 deletions
|
|
@ -24,7 +24,6 @@ code_review
|
|||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"capabilities": {
|
||||
"completions": {},
|
||||
"logging": {},
|
||||
|
|
@ -49,7 +48,6 @@ code_review
|
|||
"jsonrpc": "2.0",
|
||||
"id": 2,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"tools": []
|
||||
}
|
||||
}
|
||||
|
|
@ -57,7 +55,6 @@ code_review
|
|||
"jsonrpc": "2.0",
|
||||
"id": 4,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"prompts": [
|
||||
{
|
||||
"arguments": [
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ info.txt
|
|||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"capabilities": {
|
||||
"completions": {},
|
||||
"logging": {},
|
||||
|
|
@ -69,7 +68,6 @@ info.txt
|
|||
"jsonrpc": "2.0",
|
||||
"id": 2,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"resources": [
|
||||
{
|
||||
"mimeType": "text/plain",
|
||||
|
|
@ -88,7 +86,6 @@ info.txt
|
|||
"jsonrpc": "2.0",
|
||||
"id": 3,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"contents": [
|
||||
{
|
||||
"uri": "embedded:info",
|
||||
|
|
@ -107,7 +104,6 @@ info.txt
|
|||
"jsonrpc": "2.0",
|
||||
"id": 3,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"contents": [
|
||||
{
|
||||
"uri": "file:///info.txt",
|
||||
|
|
|
|||
4
mcp/testdata/conformance/server/tools.txtar
vendored
4
mcp/testdata/conformance/server/tools.txtar
vendored
|
|
@ -27,7 +27,6 @@ greet
|
|||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"capabilities": {
|
||||
"completions": {},
|
||||
"logging": {},
|
||||
|
|
@ -52,7 +51,6 @@ greet
|
|||
"jsonrpc": "2.0",
|
||||
"id": 2,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"tools": [
|
||||
{
|
||||
"description": "say hi",
|
||||
|
|
@ -79,7 +77,6 @@ greet
|
|||
"jsonrpc": "2.0",
|
||||
"id": 3,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"resources": []
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +84,6 @@ greet
|
|||
"jsonrpc": "2.0",
|
||||
"id": 4,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"prompts": []
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ response with its latest supported version.
|
|||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"capabilities": {
|
||||
"completions": {},
|
||||
"logging": {},
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ support.
|
|||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"result": {
|
||||
"_meta": {},
|
||||
"capabilities": {
|
||||
"completions": {},
|
||||
"logging": {},
|
||||
|
|
|
|||
Loading…
Reference in a new issue