bear_open_tag
Access notes tagged with specific keywords in Bear App. Specify tags and Bear API token to retrieve organized notes directly through the Bear App MCP Server integration.
Instructions
Open notes with specific tag(s)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Tag name or comma-separated list of tags | |
| show_window | No | Show Bear window | |
| token | No | Bear API token |
Implementation Reference
- src/index.ts:890-909 (handler)The main handler function for the 'bear_open_tag' tool. It constructs parameters from input args, calls executeWithCallback with 'open-tag' action to interact with Bear app, and returns a structured response with notes data.private async openTag(args: any) { const params: Record<string, string | boolean> = { name: args.name }; if (args.token) params.token = args.token; if (args.show_window) params.show_window = "yes"; const tagData = await this.executeWithCallback("open-tag", params); return { content: [ { type: "text", text: JSON.stringify({ message: `Opened notes with tag: ${args.name}`, notes: tagData }, null, 2) } ] }; }
- src/index.ts:486-507 (schema)Tool schema definition including name, description, and inputSchema specifying parameters: name (required), token, show_window.{ name: "bear_open_tag", description: "Open notes with specific tag(s)", inputSchema: { type: "object", properties: { name: { type: "string", description: "Tag name or comma-separated list of tags" }, token: { type: "string", description: "Bear API token" }, show_window: { type: "boolean", description: "Show Bear window" } }, required: ["name"] } },
- src/index.ts:704-742 (registration)Registration/dispatch of tool handlers in the CallToolRequestSchema handler switch statement, routing 'bear_open_tag' to this.openTag method.switch (name) { case "bear_open_note": return await this.openNote(args); case "bear_create_note": return await this.createNote(args); case "bear_add_text": return await this.addText(args); case "bear_add_file": return await this.addFile(args); case "bear_search": return await this.search(args); case "bear_get_tags": return await this.getTags(args); case "bear_open_tag": return await this.openTag(args); case "bear_trash_note": return await this.trashNote(args); case "bear_archive_note": return await this.archiveNote(args); case "bear_get_untagged": return await this.getUntagged(args); case "bear_get_todo": return await this.getTodo(args); case "bear_get_today": return await this.getToday(args); case "bear_get_locked": return await this.getLocked(args); case "bear_grab_url": return await this.grabUrl(args); case "bear_rename_tag": return await this.renameTag(args); case "bear_delete_tag": return await this.deleteTag(args); default: throw new McpError( ErrorCode.MethodNotFound, `Unknown tool: ${name}` ); }