Skip to content

mcp: add ttl for list results (SEP-2549)#1008

Merged
guglielmo-san merged 15 commits into
mainfrom
guglielmoc/2549_ttl_for_list_results
Jun 18, 2026
Merged

mcp: add ttl for list results (SEP-2549)#1008
guglielmo-san merged 15 commits into
mainfrom
guglielmoc/2549_ttl_for_list_results

Conversation

@guglielmo-san

Copy link
Copy Markdown
Contributor

Fixes #994

Remove the separate toolCache (name->*Tool map) used by CallTool to inject
tool definitions into the request context for transport-layer features
(x-mcp-header annotations). Instead, source tool definitions from the
existing TTL cache (toolsCache) via a new ClientSession.lookupTool helper
that walks cached ListToolsResult entries.

toolsCache is now always populated by ListTools (independent of DisableCache
and TTL hint), so the x-mcp-header feature keeps working even when caching
is disabled. The TTL hint still governs whether ListTools returns a cached
result on the next call.
…or_list_results

# Conflicts:
#	mcp/client.go
@guglielmo-san guglielmo-san marked this pull request as ready for review June 15, 2026 14:07
@guglielmo-san guglielmo-san requested a review from jba June 15, 2026 14:08
@guglielmo-san guglielmo-san changed the title mcp: add ttl for list results (SEP-2575) mcp: add ttl for list results (SEP-2549) Jun 16, 2026
@guglielmo-san guglielmo-san merged commit 6333aa7 into main Jun 18, 2026
9 checks passed
@guglielmo-san guglielmo-san deleted the guglielmoc/2549_ttl_for_list_results branch June 18, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SEP-2549: TTL for List Results

2 participants