bear_search
Search notes in Bear App using specific terms or tags. Enter a search term, tag, and Bear API token to locate relevant notes efficiently.
Instructions
Search for notes in Bear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| show_window | No | Show Bear window | |
| tag | No | Tag to search within | |
| term | No | Search term | |
| token | No | Bear API token |
Implementation Reference
- src/index.ts:846-867 (handler)The main handler function that executes the bear_search tool. It constructs parameters for the Bear search x-callback-url, calls executeWithCallback to run it and capture results, then returns formatted content with search results.private async search(args: any) { const params: Record<string, string | boolean> = {}; if (args.term) params.term = args.term; if (args.tag) params.tag = args.tag; if (args.token) params.token = args.token; if (args.show_window) params.show_window = "yes"; const searchData = await this.executeWithCallback("search", params); return { content: [ { type: "text", text: JSON.stringify({ message: `Searched Bear for: ${args.term || "all notes"}${args.tag ? ` in tag: ${args.tag}` : ""}`, results: searchData }, null, 2) } ] }; }
- src/index.ts:447-470 (registration)Registers the bear_search tool in the ListTools response, including its name, description, and input schema.name: "bear_search", description: "Search for notes in Bear", inputSchema: { type: "object", properties: { term: { type: "string", description: "Search term" }, tag: { type: "string", description: "Tag to search within" }, token: { type: "string", description: "Bear API token" }, show_window: { type: "boolean", description: "Show Bear window" } } } },
- src/index.ts:449-469 (schema)Defines the input schema for the bear_search tool, specifying parameters like term, tag, token, and show_window.inputSchema: { type: "object", properties: { term: { type: "string", description: "Search term" }, tag: { type: "string", description: "Tag to search within" }, token: { type: "string", description: "Bear API token" }, show_window: { type: "boolean", description: "Show Bear window" } } }
- src/index.ts:713-714 (handler)Dispatch case in the CallToolRequestSchema handler that routes bear_search calls to the search method.case "bear_search": return await this.search(args);