bear_search
Search for notes in Bear app using keywords or tags to find specific information quickly.
Instructions
Search for notes in Bear
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "bear_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | No | Search term | |
| tag | No | Tag to search within | |
| token | No | Bear API token | |
| show_window | No | Show Bear window |
Implementation Reference
- src/index.ts:846-867 (handler)The main handler function for the 'bear_search' tool. It processes input arguments, constructs parameters for Bear's search URL, executes the search via executeWithCallback, and returns the results in a formatted text response.
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:446-470 (schema)Defines the tool name, description, and input schema for validation in the ListTools response.
{ 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:713-714 (registration)The switch case that registers and dispatches to the bear_search handler in the CallToolRequestHandler.
case "bear_search": return await this.search(args);