bear_search
Full-text search across Bear note titles, tags, and body content. Returns matching notes ranked by relevance with text snippets and locked note indicators.
Instructions
Full-text search across Bear note titles, tags, and body content. Returns matching notes ranked by relevance (title matches first, then tag, then body). Body matches include a text snippet with surrounding context. Locked/private notes will match by title but may not match body searches — results include 'locked: true' for these notes. If you can't find content you expect, try listing notes to check if the relevant note is locked.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query text | |
| limit | No | Maximum number of results (default 20) | |
| since | No | Only notes modified after this date (YYYY-MM-DD, or: today, yesterday, last-week, last-month) | |
| before | No | Only notes modified before this date (YYYY-MM-DD) |
Implementation Reference
- mcp-server/src/tools.ts:90-113 (schema)Input schema for bear_search tool: requires 'query' (string), optional 'limit' (number), 'since' (string date), 'before' (string date)
inputSchema: { type: "object" as const, properties: { query: { type: "string", description: "Search query text", }, limit: { type: "number", description: "Maximum number of results (default 20)", }, since: { type: "string", description: "Only notes modified after this date (YYYY-MM-DD, or: today, yesterday, last-week, last-month)", }, before: { type: "string", description: "Only notes modified before this date (YYYY-MM-DD)", }, }, required: ["query"], }, - mcp-server/src/tools.ts:120-127 (handler)Handler (buildArgs) for bear_search: constructs CLI args array ['search', query, '--json'] with optional limit/since/before flags
buildArgs: (input) => { const args = ["search", String(input.query), "--json"]; if (input.limit) args.push("--limit", String(input.limit)); if (input.since) args.push("--since", String(input.since)); if (input.before) args.push("--before", String(input.before)); return args; }, }, - mcp-server/src/tools.ts:85-127 (registration)Registration of bear_search in the tools registry (Record<string, ToolHandler>)
bear_search: { tool: { name: "bear_search", description: "Full-text search across Bear note titles, tags, and body content. Returns matching notes ranked by relevance (title matches first, then tag, then body). Body matches include a text snippet with surrounding context. Locked/private notes will match by title but may not match body searches — results include 'locked: true' for these notes. If you can't find content you expect, try listing notes to check if the relevant note is locked.", inputSchema: { type: "object" as const, properties: { query: { type: "string", description: "Search query text", }, limit: { type: "number", description: "Maximum number of results (default 20)", }, since: { type: "string", description: "Only notes modified after this date (YYYY-MM-DD, or: today, yesterday, last-week, last-month)", }, before: { type: "string", description: "Only notes modified before this date (YYYY-MM-DD)", }, }, required: ["query"], }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["search", String(input.query), "--json"]; if (input.limit) args.push("--limit", String(input.limit)); if (input.since) args.push("--since", String(input.since)); if (input.before) args.push("--before", String(input.before)); return args; }, },