mcp: do not enforce TTL on cached tool (#1053)

This PR removes the TTL enforcing on the cached tools, when used to
generate the http-parameters for CallTool, according to updated
[spec](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2972)

> Clients **MUST** construct `Mcp-Param-*` headers using the most
recently obtained `inputSchema` for the tool.
This commit is contained in:
Guglielmo Colombo 2026-07-07 13:43:10 +02:00 • committed by GitHub
commit 6de85ec3ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,18 +54,6 @@ func (mc *methodCache[R]) put(key string, result R) {
}
}
func (mc *methodCache[R]) forEachValid(f func(R)) {
mc.mu.Lock()
defer mc.mu.Unlock()
for key, entry := range mc.cachedValues {
if !entry.isValid() {
delete(mc.cachedValues, key)
continue
}
f(entry.result)
}
}
func (mc *methodCache[R]) invalidate() {
mc.mu.Lock()
defer mc.mu.Unlock()