Skip to content
{mcpdesc}

Express cache lifetimes as non-negative integers

Resource example ttlMs values are non-negative integer milliseconds. This value constraint also applies when an older protocol version permits the field without defining it. Replace fractions or negative values with the intended duration rather than relying on automatic rounding.

ttlMs in a Resource example result is a non-negative integer when present.

Rule ID: mcp.cacheable-result.ttl-ms
Owner: mcp
Surface: CacheableResult · Path: ttlMs
Kind: structural
Requirement level: must
Protocol versions: independent of the MCP protocol version
Document schema locations: #/$defs/completedReadResourceResultExample/properties/ttlMs
Status: arbitrated · Enforcement: internal

MCP defines ttlMs from 2026-07-28 only. In earlier protocol versions it is a field not defined by the MCP protocol version (mcp.result.additional-properties.preserve), and Section 3.6 keeps the same value constraint so that one example can serve several protocol versions.

Source: expected-valid/named-resource-examples.json · Selected: /resources/1/examples/two-files/result/ttlMs

60000

Source: expected-invalid/fractional-ttl-ms.json · Selected: /resources/0/examples/cached/result/ttlMs

60000.5

Source: expected-invalid/resource-example-cache-fields.json · Selected: /resources/1/examples/invalid/result/ttlMs

-1

result.yaml at immutable tag v0.9.0-rc.3.