{"record":{"id":"8cb1ff8079bdca6d","repo":"nexu-io/open-design","slug":"unsupported-resource-uri-uri","errorCode":null,"errorMessage":"unsupported resource URI: ${uri}","messagePattern":"unsupported resource URI: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/daemon/src/mcp.ts","lineNumber":1857,"sourceCode":"    if (uri === 'od://focus/active') {\n      const result = await daemonTarget.call('read_resource', {}, async (baseUrl) =>\n        ok(await getJson<ActiveContext>(`${baseUrl}/api/active`)),\n      );\n      if (result.isError === true) throw new Error(result.content[0]?.text);\n      const data = parseMcpResult(result);\n      return {\n        contents: [\n          {\n            uri,\n            mimeType: 'application/json',\n            text: JSON.stringify(data, null, 2),\n          },\n        ],\n      };\n    }\n    const m = String(uri || '').match(/^od:\\/\\/(skills|design-systems)\\/([^/]+)\\/(.+)$/);\n    if (!m) {\n      throw new Error(`unsupported resource URI: ${uri}`);\n    }\n    const [, kind, id] = m as [string, 'skills' | 'design-systems', string, string];\n    const route = kind === 'skills' ? 'skills' : 'design-systems';\n    const result = await daemonTarget.call('read_resource', {}, async (baseUrl) =>\n      ok(await getJson<ResourcePayload>(\n        `${baseUrl}/api/${route}/${encodeURIComponent(decodeURIComponent(id))}`,\n      )),\n    );\n    if (result.isError === true) throw new Error(result.content[0]?.text);\n    const data = parseMcpResult(result) as ResourcePayload | null;\n    const text =\n      data?.skill?.body ??\n      data?.skill?.content ??\n      data?.designSystem?.body ??\n      data?.designSystem?.content ??\n      data?.body ??\n      data?.content ??\n      '';","sourceCodeStart":1839,"sourceCodeEnd":1875,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/mcp.ts#L1839-L1875","documentation":"The read_resource handler in mcp.ts accepts only od:// URIs of two shapes: od://skills/<id>/<path> and od://design-systems/<id>/<path> (plus an earlier od://active branch). Anything not matching the regex ^od://(skills|design-systems)/([^/]+)/(.+)$ throws.","triggerScenarios":"A client requests a non-od:// URI; a malformed od:// URI; an od:// kind other than skills or design-systems; a URI missing the id or trailing path segment.","commonSituations":"An external agent enumerated resources from elsewhere and tried to read them here; the URI was truncated.","solutions":["Use od://skills/<id>/<path> or od://design-systems/<id>/<path>.","For active context use od://active.","Ensure both the id and the trailing path segment are present."],"exampleFix":"// before\nread_resource('https://example.com/skills/foo')\n\n// after\nread_resource('od://skills/foo/SKILL.md')","handlingStrategy":"type-guard","validationCode":"const RE = /^od:\\/\\/(skills|design-systems)\\/([^/]+)\\/(.+)$/;\nif (uri !== 'od://active' && !RE.test(uri)) {\n  throw new Error(`unsupported resource URI: ${uri}`);\n}","typeGuard":"function isOdResourceUri(u: unknown): boolean {\n  return typeof u === 'string'\n    && (u === 'od://active'\n      || /^od:\\/\\/(skills|design-systems)\\/([^/]+)\\/(.+)$/.test(u));\n}","tryCatchPattern":null,"preventionTips":["Build od:// URIs from known skills or design-system ids.","Reject foreign schemes before calling read_resource.","Always include the id and the trailing path segment."],"tags":["mcp","resource","uri"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}