addNote
Add notes to organize ideas or learning content in your structured knowledge base, enabling automated organization and retrieval of information.
Instructions
Add a note to the ideas or learning section
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The note content | |
| file | No | Which section to add the note to | ideas |
Implementation Reference
- src/core/brain.ts:201-226 (handler)The core implementation of the addNote functionality, which handles file updates or creation in the brain.
async addNote(text: string, section: "ideas" | "learning"): Promise<void> { const log = getLogger(); const brainSection: BrainSection = `notes/${section}`; try { await this.sync.atomicUpdate( brainSection, (current) => appendNote(current, text), `feat(ai): add note to ${section}` ); log.info("addNote", { section, text }); } catch (err) { if (isNotFound(err)) { const title = section === "ideas" ? "Ideas" : "Learning"; const content = appendNote(`# ${title}\n\n`, text); await this.sync.createSection( brainSection, content, `feat(ai): create ${section} with new note` ); log.info("addNote: created file", { section }); return; } throw err; } } - src/tools/notes.ts:22-39 (registration)Registration of the "addNote" tool with its schema definition and handler execution.
server.registerTool( "addNote", { description: "Add a note to the ideas or learning section", inputSchema: { content: z.string().describe("The note content"), file: z .enum(["ideas", "learning"]) .optional() .default("ideas") .describe("Which section to add the note to"), }, }, toolHandler("addNote", async ({ content, file }) => { await brain.addNote(content, file); return { success: true }; }) );