bear_open_note
Open specific notes in Bear App by ID, title, or search terms, with options to pin, edit, or float the note window for efficient organization and access.
Instructions
Open a note in Bear by ID or title
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edit | No | Place cursor in note editor | |
| exclude_trashed | No | Exclude trashed notes | |
| float | No | Float note window | |
| header | No | Header inside the note | |
| id | No | Note unique identifier | |
| new_window | No | Open in external window (macOS only) | |
| open_note | No | Open note after command | |
| pin | No | Pin note to top of list | |
| search | No | Search term within note | |
| selected | No | Selected text in note | |
| show_window | No | Show Bear window | |
| title | No | Note title |
Implementation Reference
- src/index.ts:752-779 (handler)The primary handler function `openNote` for the 'bear_open_note' tool. It processes input arguments into parameters for Bear's URL scheme, executes the open-note action using `executeWithCallback`, and returns the note data as a text content block.private async openNote(args: any) { const params: Record<string, string | boolean> = {}; if (args.id) params.id = args.id; if (args.title) params.title = args.title; if (args.header) params.header = args.header; if (args.exclude_trashed) params.exclude_trashed = "yes"; if (args.new_window) params.new_window = "yes"; if (args.edit) params.edit = "yes"; if (args.selected) params.selected = args.selected; if (args.pin) params.pin = "yes"; if (args.float) params.float = "yes"; if (args.show_window) params.show_window = "yes"; if (args.open_note) params.open_note = "yes"; if (args.search) params.search = args.search; // Set up a temporary HTTP server to capture the x-success callback const noteData = await this.executeWithCallback("open-note", params); return { content: [ { type: "text", text: JSON.stringify(noteData, null, 2) } ] }; }
- src/index.ts:198-253 (schema)The input schema definition for the 'bear_open_note' tool, specifying properties like id, title, header, and various boolean flags for Bear app interactions.{ name: "bear_open_note", description: "Open a note in Bear by ID or title", inputSchema: { type: "object", properties: { id: { type: "string", description: "Note unique identifier" }, title: { type: "string", description: "Note title" }, header: { type: "string", description: "Header inside the note" }, exclude_trashed: { type: "boolean", description: "Exclude trashed notes" }, new_window: { type: "boolean", description: "Open in external window (macOS only)" }, edit: { type: "boolean", description: "Place cursor in note editor" }, selected: { type: "string", description: "Selected text in note" }, pin: { type: "boolean", description: "Pin note to top of list" }, float: { type: "boolean", description: "Float note window" }, show_window: { type: "boolean", description: "Show Bear window" }, open_note: { type: "boolean", description: "Open note after command" }, search: { type: "string", description: "Search term within note" } } }
- src/index.ts:705-706 (registration)Registration of the 'bear_open_note' handler in the central tool dispatcher switch statement within the CallToolRequestSchema handler.case "bear_open_note": return await this.openNote(args);