# `ExMCP.Protocol.CacheableResult`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/protocol/cacheable_result.ex#L1)

Defines and validates the cache hints required by modern MCP results.

The method set is pinned to the `CacheableResult` implementors in the
vendored 2026-07-28 schema. A schema-sync test derives that set directly
from `schema.json`, so a future spec update cannot silently leave this
runtime table stale.

This module validates wire metadata only. It does not store or reuse
responses.

# `result_kind`

```elixir
@type result_kind() :: :complete | :input_required | {:extension, String.t()}
```

# `validation_error`

```elixir
@type validation_error() ::
  :missing_ttl_ms
  | {:invalid_ttl_ms, term()}
  | :missing_cache_scope
  | {:invalid_cache_scope, term()}
  | :cache_hints_not_allowed
```

# `cacheable_method?`

```elixir
@spec cacheable_method?(term()) :: boolean()
```

Returns whether a method has a cacheable complete result in MCP 2026-07-28.

# `methods`

```elixir
@spec methods() :: [String.t()]
```

Returns the schema-defined methods whose complete results carry cache hints.

# `validate`

```elixir
@spec validate(term(), result_kind(), map()) :: :ok | {:error, validation_error()}
```

Validates cache hints for a classified modern result.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
