MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / readNote

Function readNote

apps/desktop/src/mcp/vault-ops.ts:560–567  ·  view source on GitHub ↗
(root: string, rel: string)

Source from the content-addressed store, hash-verified

558/* ---------- Read / write / create ------------------------------------ */
559
560export async function readNote(root: string, rel: string): Promise<NoteContent> {
561 const abs = resolveSafe(root, rel)
562 const folder = folderOf(root, abs)
563 if (!folder) throw new Error(`Note not in a known folder: ${rel}`)
564 const body = await fs.readFile(abs, 'utf8')
565 const meta = await readMeta(root, abs, folder)
566 return { ...meta, body }
567}
568
569export async function writeNote(root: string, rel: string, body: string): Promise<NoteMeta> {
570 const abs = resolveSafe(root, rel)

Callers 1

server.tsFile · 0.70

Calls 3

resolveSafeFunction · 0.70
folderOfFunction · 0.70
readMetaFunction · 0.70

Tested by

no test coverage detected