Describe the bug
Some hosted MCP servers send cacheScope: "" on tools/list and resources/read results. SEP-2549 only allows "public", "private", or omitting the field, so serde rejects the empty string. Because ServerResult is an untagged enum, that failure does not stay on ListToolsResult. The payload falls through to CustomResult, and the client ends up with no tools.
Negative ttlMs is already normalized. Empty cacheScope is not.
To Reproduce
Deserialize a valid tools/list result that includes an empty cache scope:
{
"tools": [{ "name": "search", "inputSchema": { "type": "object" } }],
"ttlMs": 0,
"cacheScope": ""
}
On current main this does not parse as ListToolsResult.
Expected behavior
Treat an exact empty cacheScope the same as an omitted field (None). Unknown values such as "shared" or " " should still fail.
Additional context
I hit this against a hosted server that emits cacheScope: "" on an otherwise valid tools/list body. The tools were present on the wire and disappeared after decode.
Describe the bug
Some hosted MCP servers send
cacheScope: ""ontools/listandresources/readresults. SEP-2549 only allows"public","private", or omitting the field, so serde rejects the empty string. BecauseServerResultis an untagged enum, that failure does not stay onListToolsResult. The payload falls through toCustomResult, and the client ends up with no tools.Negative
ttlMsis already normalized. EmptycacheScopeis not.To Reproduce
Deserialize a valid
tools/listresult that includes an empty cache scope:{ "tools": [{ "name": "search", "inputSchema": { "type": "object" } }], "ttlMs": 0, "cacheScope": "" }On current
mainthis does not parse asListToolsResult.Expected behavior
Treat an exact empty
cacheScopethe same as an omitted field (None). Unknown values such as"shared"or" "should still fail.Additional context
I hit this against a hosted server that emits
cacheScope: ""on an otherwise validtools/listbody. The tools were present on the wire and disappeared after decode.