create_note
Create and organize text or checklist notes with titles, content, colors, and optional images for effective note management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the note | |
| content | No | Content/body of the note (for text notes) | |
| type | No | Type of note: 'text' for regular notes, 'list' for checklists | text |
| checklist | No | Checklist items (for list notes). Each item has 'text' and optional 'checked' boolean | |
| color | No | Note background color | white |
| imageUrl | No | URL of an image to attach to the note |
Implementation Reference
- src/index.ts:118-142 (handler)The handler function for 'create_note' which constructs the note object and performs an API request to create it.
async ({ title, content, type, checklist, color, imageUrl }) => { try { const body: Record<string, any> = { title, type, color }; if (type === "text") { body.content = content || ""; } else if (type === "list" && checklist) { body.checklist = checklist; } if (imageUrl) { body.imageUrl = imageUrl; } const data = await apiRequest("/api/notes", { method: "POST", body: JSON.stringify(body), }); return { content: [{ type: "text", text: `Note created successfully!\nID: ${data.note.id}\nTitle: ${data.note.title}` }] }; - src/index.ts:107-117 (schema)The Zod schema defining the input parameters for the 'create_note' tool.
{ title: z.string().describe("Title of the note"), content: z.string().optional().describe("Content/body of the note (for text notes)"), type: z.enum(["text", "list"]).optional().default("text").describe("Type of note: 'text' for regular notes, 'list' for checklists"), checklist: z.array(z.object({ text: z.string(), checked: z.boolean().optional().default(false) })).optional().describe("Checklist items (for list notes). Each item has 'text' and optional 'checked' boolean"), color: z.enum(["white", "gray", "yellow", "orange", "teal", "blue", "purple", "pink"]).optional().default("white").describe("Note background color"), imageUrl: z.string().url().optional().describe("URL of an image to attach to the note"), }, - src/index.ts:105-117 (registration)The registration of the 'create_note' tool using the server.tool method.
server.tool( "create_note", { title: z.string().describe("Title of the note"), content: z.string().optional().describe("Content/body of the note (for text notes)"), type: z.enum(["text", "list"]).optional().default("text").describe("Type of note: 'text' for regular notes, 'list' for checklists"), checklist: z.array(z.object({ text: z.string(), checked: z.boolean().optional().default(false) })).optional().describe("Checklist items (for list notes). Each item has 'text' and optional 'checked' boolean"), color: z.enum(["white", "gray", "yellow", "orange", "teal", "blue", "purple", "pink"]).optional().default("white").describe("Note background color"), imageUrl: z.string().url().optional().describe("URL of an image to attach to the note"), },