bear_context_search
Search across Bear notes, external files, and inbox to locate matching text snippets with filenames and origin labels when the index alone is insufficient.
Instructions
Full-text search across the entire context library (Bear notes + external files + inbox). Returns matching snippets with filenames and origin labels. Use when the index alone isn't enough to find the right file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (case-insensitive substring match) | |
| limit | No | Maximum results (default: 5) |
Implementation Reference
- mcp-server/src/tools.ts:865-895 (schema)Tool definition for bear_context_search, including inputSchema (schema) and buildArgs (handler logic that builds CLI args for the bcli tool).
bear_context_search: { tool: { name: "bear_context_search", description: "Full-text search across the entire context library (Bear notes + external files + inbox). Returns matching snippets with filenames and origin labels. Use when the index alone isn't enough to find the right file.", inputSchema: { type: "object" as const, properties: { query: { type: "string", description: "Search query (case-insensitive substring match)", }, limit: { type: "number", description: "Maximum results (default: 5)", }, }, required: ["query"], }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["context", "search", String(input.query), "--json"]; if (input.limit) args.push("--limit", String(input.limit)); return args; }, },