mcp: avoid "null" in structuredContent

Avoid a typed nil in structuredContent (yet another typed nil), leading
to "null" on the wire.

Fixes #417
This commit is contained in:
Rob Findley 2025-09-04 19:58:12 +00:00 • committed by Robert Findley
commit 9d34aff732

View file

@ -1115,8 +1115,7 @@ func TestStreamableStateless(t *testing.T) {
},
wantMessages: []jsonrpc.Message{
resp(2, &CallToolResult{
Content: []Content{&TextContent{Text: "hi World"}},
StructuredContent: json.RawMessage("null"),
Content: []Content{&TextContent{Text: "hi World"}},
}, nil),
},
},
@ -1128,8 +1127,7 @@ func TestStreamableStateless(t *testing.T) {
},
wantMessages: []jsonrpc.Message{
resp(2, &CallToolResult{
Content: []Content{&TextContent{Text: "hi foo"}},
StructuredContent: json.RawMessage("null"),
Content: []Content{&TextContent{Text: "hi foo"}},
}, nil),
},
},