MCPcopy Index your code
hub / github.com/deepnote/deepnote / parseDeepnoteUri

Function parseDeepnoteUri

packages/mcp/src/resources.ts:57–68  ·  view source on GitHub ↗

* Parse a deepnote:// URI and extract the path

(uri: string)

Source from the content-addressed store, hash-verified

55 * Parse a deepnote:// URI and extract the path
56 */
57function parseDeepnoteUri(uri: string): { type: 'file' | 'examples' | 'workspace'; path?: string } {
58 if (uri.startsWith('deepnote://examples')) {
59 return { type: 'examples' }
60 }
61 if (uri.startsWith('deepnote://workspace')) {
62 return { type: 'workspace' }
63 }
64 if (uri.startsWith('deepnote://file/')) {
65 return { type: 'file', path: uri.slice('deepnote://file/'.length) }
66 }
67 return { type: 'file', path: uri.replace('deepnote://', '') }
68}
69
70/**
71 * List available resources

Callers 1

readResourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected