Merge pull request #513 from koic/fix_non_cacheable_cache_hints_test

Stop using `ping` as the non-cacheable result example
This commit is contained in:
Koichi ITO 2026-08-14 01:03:47 +09:00 • committed by GitHub
commit c3ca40f770
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4378,7 +4378,10 @@ module MCP
test "modern non-cacheable results carry no cache hints" do
server = Server.new(name: "cache_hints_test", tools: [result_type_tool])
response = server.handle(modern_request(Methods::PING, {}))
# `tools/call` is the non-cacheable example here: the spec types `CallToolResult` as a plain `Result`,
# while the results it types as `CacheableResult` are the discover, list, and read families.
# `ping` cannot stand in for it - SEP-2575 removed that method, so a modern request naming it is refused.
response = server.handle(modern_request(Methods::TOOLS_CALL, { name: "result_type_tool", arguments: {} }))
refute response[:result].key?(:ttlMs)
refute response[:result].key?(:cacheScope)