-
Notifications
You must be signed in to change notification settings - Fork 643
Empty cacheScope on tools/list drops every tool #1242
Copy link
Copy link
Labels
P2Medium: important but non-blocking improvementMedium: important but non-blocking improvementT-modelModel/data structure changesModel/data structure changesbugSomething is not workingSomething is not workingready for workIssue is well-defined and ready to be picked upIssue is well-defined and ready to be picked up
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Medium: important but non-blocking improvementMedium: important but non-blocking improvementT-modelModel/data structure changesModel/data structure changesbugSomething is not workingSomething is not workingready for workIssue is well-defined and ready to be picked upIssue is well-defined and ready to be picked up
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.