protocol
mcp_cache_protocol
Optional protocol for per-operation cache policy used by the MCP 2026-07-28 specification. An application may implement cache_policy/4 to choose TTL (milliseconds) and scope (public or private) for complete results of server/discover, list operations (tools/list, prompts/list, resources/list, resources/templates/list), and resources/read. Cache fields are never attached to input_required results or MRTR retries. When the predicate is not defined, or for an operation it does not cover, the server falls back to the options cache_ttl(0) and cache_scope(private).
logtalk_load(mcp_server(loader))static
TTL: A non-negative integer number of milliseconds.
0means the result must not be cached.Scope: Either
public(may be shared across clients) orprivate(client-specific).Applicability: Only complete final results of discover, list, and resource-read operations receive cache fields. Tool calls, prompt gets that return
input_required, and any MRTR continuation never includettlMs/cacheScope.
Public predicates
cache_policy/4
Returns the cache policy for a given operation and request. Operation is one of discover, tools_list, prompts_list, resources_list, resources_templates_list, or resources_read. Request is the request-specific identifier or arguments (e.g. a resource URI for resources_read, or a free term for list/discover). TTL is a non-negative integer (milliseconds). Scope is public or private. Failure means the server should use its configured defaults.
staticcache_policy(Operation,Request,TTL,Scope)cache_policy(+atom,+term,-integer,-atom) - zero_or_oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)