bear_list_todos
Find Bear notes with incomplete TODO items and retrieve title, tags, and completion counts.
Instructions
List Bear notes that have incomplete TODO items (markdown checkboxes like '- [ ]'). Returns each note's title, tags, and counts of complete/incomplete items.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of notes to return (default 30) |
Implementation Reference
- mcp-server/src/tools.ts:362-387 (handler)Tool handler definition for bear_list_todos. Defines the tool metadata (name, description, input schema with optional limit parameter) and the buildArgs function that constructs CLI arguments ["todo", "--json", optionally "--limit", N] to pass to the external bcli binary.
bear_list_todos: { tool: { name: "bear_list_todos", description: "List Bear notes that have incomplete TODO items (markdown checkboxes like '- [ ]'). Returns each note's title, tags, and counts of complete/incomplete items.", inputSchema: { type: "object" as const, properties: { limit: { type: "number", description: "Maximum number of notes to return (default 30)", }, }, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["todo", "--json"]; if (input.limit) args.push("--limit", String(input.limit)); return args; }, }, - mcp-server/src/tools.ts:9-9 (registration)The 'tools' registry object that maps tool names (like 'bear_list_todos') to their ToolHandler definitions. This is imported by index.ts where it's used for ListToolsRequestSchema and CallToolRequestSchema.
export const tools: Record<string, ToolHandler> = { - mcp-server/src/index.ts:29-31 (registration)Registration of bear_list_todos as an MCP tool. The server exposes all tools (including bear_list_todos) via ListToolsRequestSchema, and dispatches calls via CallToolRequestSchema which looks up the handler by name.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), })); - mcp-server/src/bcli.ts:256-268 (helper)Helper that executes the bcli CLI binary with automatic re-authentication on auth errors. The bear_list_todos handler's buildArgs produces args that are passed to this function.
export async function execBcliWithReauth( args: string[], ): Promise<{ stdout: string; stderr: string }> { try { return await execBcli(args); } catch (error) { if (error instanceof AuthError) { await performReauth(); return await execBcli(args); } throw error; } }