function resourceReadFigure(host) { ensureStyles(); var shell = document.createElement('div'); shell.className = 'mf-shell'; shell.innerHTML = [ '
Reading a Resource one URI, two lawful outcomes
', '
', '', '', '', 'template', 'file:///project/{+path}', 'path = src/app.py', '', 'expand', '', 'resources/read', 'sanitize against root', 'then look up the uri', '', 'found', '', 'missing', '', 'complete', 'contents[]', 'ttlMs + cacheScope', '', '-32602', 'data.uri', 'never empty contents[]', 'sanitize before lookup: a path segment can never resolve outside the project root', '', '', '', '', '', '
', '
A URI template expands into a concrete URI, and resources/read sanitizes it against the server\'s root before any lookup. A resource that exists returns a complete result carrying contents, ttlMs, and cacheScope. A resource that does not exist, or a path that tries to climb outside the root, returns JSON-RPC error -32602 naming the requested URI in data.uri, never a successful result with an empty contents array.
' ].join(''); host.appendChild(shell); } // register as: mcpa-12-resource-read