bear_create_note
Create a new note in Bear with customizable title, content, tags, attachments, and display options to organize information efficiently.
Instructions
Create a new note in Bear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Note title | |
| text | No | Note content | |
| tags | No | Comma-separated list of tags | |
| pin | No | Pin note to top of list | |
| timestamp | No | Prepend current date and time | |
| clipboard | No | Get text from clipboard | |
| file | No | File path to add to note | |
| filename | No | Custom filename for attached file | |
| open_note | No | Open note after creation | |
| new_window | No | Open in new window | |
| float | No | Float note window | |
| show_window | No | Show Bear window | |
| edit | No | Place cursor in note editor | |
| type | No | Note type | |
| url | No | URL to include in note |
Implementation Reference
- src/index.ts:781-813 (handler)The main handler function for the 'bear_create_note' tool. It maps input arguments to Bear URL parameters, executes the 'create' action via callback, and returns the note data.private async createNote(args: any) { const params: Record<string, string | boolean> = {}; if (args.title) params.title = args.title; if (args.text) params.text = args.text; if (args.tags) params.tags = args.tags; if (args.pin) params.pin = "yes"; if (args.timestamp) params.timestamp = "yes"; if (args.clipboard) params.clipboard = "yes"; if (args.file) params.file = args.file; if (args.filename) params.filename = args.filename; if (args.open_note) params.open_note = "yes"; if (args.new_window) params.new_window = "yes"; if (args.float) params.float = "yes"; if (args.show_window) params.show_window = "yes"; if (args.edit) params.edit = "yes"; if (args.type) params.type = args.type; if (args.url) params.url = args.url; const noteData = await this.executeWithCallback("create", params); return { content: [ { type: "text", text: JSON.stringify({ message: `Created new note in Bear${args.title ? ` with title: ${args.title}` : ""}`, note: noteData }, null, 2) } ] }; }
- src/index.ts:255-323 (schema)The input schema defining parameters for the 'bear_create_note' tool, registered in the list of available tools.{ name: "bear_create_note", description: "Create a new note in Bear", inputSchema: { type: "object", properties: { title: { type: "string", description: "Note title" }, text: { type: "string", description: "Note content" }, tags: { type: "string", description: "Comma-separated list of tags" }, pin: { type: "boolean", description: "Pin note to top of list" }, timestamp: { type: "boolean", description: "Prepend current date and time" }, clipboard: { type: "boolean", description: "Get text from clipboard" }, file: { type: "string", description: "File path to add to note" }, filename: { type: "string", description: "Custom filename for attached file" }, open_note: { type: "boolean", description: "Open note after creation" }, new_window: { type: "boolean", description: "Open in new window" }, float: { type: "boolean", description: "Float note window" }, show_window: { type: "boolean", description: "Show Bear window" }, edit: { type: "boolean", description: "Place cursor in note editor" }, type: { type: "string", description: "Note type" }, url: { type: "string", description: "URL to include in note" } } } },
- src/index.ts:707-708 (registration)Switch case registration that dispatches 'bear_create_note' tool calls to the createNote handler method.case "bear_create_note": return await this.createNote(args);