mcp: update return meta in DiscoverResult (SEP-2575) (#1097)

This PR implements the latest changes introduced by
https://github.com/modelcontextprotocol/modelcontextprotocol/pull/3002
This commit is contained in:
Guglielmo Colombo 2026-07-16 16:10:12 +02:00 • committed by GitHub
commit 5cb8339210
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -224,4 +224,12 @@ func TestContentUnmarshalNilWithInvalidContent(t *testing.T) {
}
}
var ctrCmpOpts = []cmp.Option{cmpopts.IgnoreUnexported(mcp.CallToolResult{}, mcp.GetPromptResult{}, mcp.ReadResourceResult{})}
var ctrCmpOpts = []cmp.Option{
cmpopts.IgnoreUnexported(mcp.CallToolResult{}, mcp.GetPromptResult{}, mcp.ReadResourceResult{}),
// Server responses under the >= 2026-07-28 protocol carry an auto-populated
// [mcp.MetaKeyServerInfo] entry; tests that compare result bodies against
// hand-crafted expected values should ignore it.
cmpopts.IgnoreFields(mcp.CallToolResult{}, "Meta"),
cmpopts.IgnoreFields(mcp.GetPromptResult{}, "Meta"),
cmpopts.IgnoreFields(mcp.ReadResourceResult{}, "Meta"),
}