bear_list_notes
Retrieve Bear notes with optional tag filtering, returning note IDs, titles, tags, pin status, and modification dates. Includes both full tag expansion and leaf-only tags.
Instructions
List Bear notes with optional tag filtering. Returns an array of notes with IDs, titles, tags, pin status, and modification dates. Each note includes two tag fields: 'tags' mirrors Bear's CloudKit index verbatim (includes ancestor expansions — a note tagged #parent/child will show both 'parent' and 'parent/child'); 'attached_tags' shows only leaf tags (the most-specific tag on each branch). Notes with 'locked: true' are private/encrypted in Bear and their body content is not searchable — if a search returns no results, check whether the relevant note is locked. Use bear_get_note to read the full content of a specific note.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Filter notes by tag (partial match) | |
| include_archived | No | Include archived notes in results | |
| include_trashed | No | Include trashed notes in results | |
| limit | No | Maximum number of notes to return (default 30) |
Implementation Reference
- mcp-server/src/tools.ts:9-51 (registration)The 'bear_list_notes' tool is defined in the tools registry map along with its schema, description, and the buildArgs function that constructs CLI args for the 'bcli' executable.
export const tools: Record<string, ToolHandler> = { bear_list_notes: { tool: { name: "bear_list_notes", description: "List Bear notes with optional tag filtering. Returns an array of notes with IDs, titles, tags, pin status, and modification dates. Each note includes two tag fields: 'tags' mirrors Bear's CloudKit index verbatim (includes ancestor expansions — a note tagged #parent/child will show both 'parent' and 'parent/child'); 'attached_tags' shows only leaf tags (the most-specific tag on each branch). Notes with 'locked: true' are private/encrypted in Bear and their body content is not searchable — if a search returns no results, check whether the relevant note is locked. Use bear_get_note to read the full content of a specific note.", inputSchema: { type: "object" as const, properties: { tag: { type: "string", description: "Filter notes by tag (partial match)", }, include_archived: { type: "boolean", description: "Include archived notes in results", }, include_trashed: { type: "boolean", description: "Include trashed notes in results", }, limit: { type: "number", description: "Maximum number of notes to return (default 30)", }, }, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["ls", "--json"]; if (input.tag) args.push("--tag", String(input.tag)); if (input.include_archived) args.push("--archived"); if (input.include_trashed) args.push("--trashed"); if (input.limit) args.push("--limit", String(input.limit)); return args; }, }, - mcp-server/src/tools.ts:15-36 (schema)Input schema for bear_list_notes defining four optional parameters: tag (string), include_archived (boolean), include_trashed (boolean), and limit (number).
inputSchema: { type: "object" as const, properties: { tag: { type: "string", description: "Filter notes by tag (partial match)", }, include_archived: { type: "boolean", description: "Include archived notes in results", }, include_trashed: { type: "boolean", description: "Include trashed notes in results", }, limit: { type: "number", description: "Maximum number of notes to return (default 30)", }, }, }, - mcp-server/src/index.ts:81-90 (handler)The handler logic in index.ts dispatches tool calls: it calls the tool's buildArgs to get CLI arguments, then executes the 'bcli' CLI tool via execBcliWithReauth. For bear_list_notes, buildArgs returns ['ls', '--json', ...] and the result (JSON) is parsed and returned.
const args = handler.buildArgs(params); let result: { stdout: string; stderr: string }; // Check if this tool needs stdin piping const stdinData = handler.usesStdin?.(params) ?? null; if (stdinData !== null) { result = await execBcliWithStdinAndReauth(args, stdinData); } else { result = await execBcliWithReauth(args); } - mcp-server/src/index.ts:29-31 (registration)The MCP server registers all tools (including bear_list_notes) via ListToolsRequestSchema and handles calls via CallToolRequestSchema, looking up the tool by name in the tools map.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), }));