Skip to content

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

Draft
guglielmo-san wants to merge 12 commits into
mainfrom
guglielmoc/2549_ttl_for_list_results
Draft

mcp: add ttl for list results (SEP-2575)#1008
guglielmo-san wants to merge 12 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
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

1 participant