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.
Requirement
Section titled “Requirement”ttlMs in a Resource example result is a non-negative integer when present.
Details
Section titled “Details”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
Required by
Section titled “Required by”- MCP Description 0.9.0, Sections 3.6 and 10.4.4
- 3. Document Structure: req-mcp-integer-numbers
-
- Resources and Resource Templates: req-resource-example-result-shape
- Proposal 0029, Integer MCP Numbers
Based on
Section titled “Based on”- Tier 1 — MCP schema.ts and normative specification text: MCP 2026-07-28 schema.ts, interface CacheableResult, ttlMs (unannotated number, @minimum 0)
- Tier 3 — Generated MCP schema.json: MCP 2026-07-28 generated schema.json, ReadResourceResult.ttlMs typed integer
- Tier 3 — Generated MCP schema.json: MCP scripts/generate-schemas.ts: typescript-json-schema –defaultNumberType integer
Gaps and arbitrations
Section titled “Gaps and arbitrations”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.
Examples
Section titled “Examples”Valid example
Section titled “Valid example”Source: expected-valid/named-resource-examples.json · Selected: /resources/1/examples/two-files/result/ttlMs
60000Invalid example
Section titled “Invalid example”Source: expected-invalid/fractional-ttl-ms.json · Selected: /resources/0/examples/cached/result/ttlMs
60000.5Invalid example
Section titled “Invalid example”Source: expected-invalid/resource-example-cache-fields.json · Selected: /resources/1/examples/invalid/result/ttlMs
-1Rule Source Code
Section titled “Rule Source Code”result.yaml at immutable tag v0.9.0-rc.3.