Skip to content

@maxhealth.tech/prefab / mcp / resolveCache

Function: resolveCache()

ts
function resolveCache(hint?, defaults?): Required<McpCacheHint>;

Defined in: mcp/resource.ts:325

Fill in and validate the CacheableResult fields, rejecting values the SDK would silently discard in favour of ttlMs: 0.

defaults differ per resource kind: the viewer HTML is a pure function of the package version and is safely shared-cacheable, while an a2ui:// surface is rebuilt on every read and defaults to no caching. Exported so ./a2ui.ts resolves its hints through the same guard rather than restating it.

Parameters

ParameterTypeDefault value
hint?McpCacheHintundefined
defaults?Required<McpCacheHint>DEFAULT_VIEWER_CACHE

Returns

Required<McpCacheHint>

Released under the MIT License.