bear_find_duplicates
Find groups of notes sharing identical titles, each marked with its ID and modification date. Clean up duplicates after imports or sync conflicts.
Instructions
Find notes with duplicate titles. Returns groups of notes sharing the same title with their IDs and modification dates. Useful for cleaning up after imports or sync conflicts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server/src/tools.ts:710-726 (handler)The 'bear_find_duplicates' tool handler. The 'buildArgs' function constructs CLI arguments ['duplicates', '--json'] which are executed by execBcliWithReauth. The tool calls the external 'bcli' CLI with 'duplicates --json' to find notes with duplicate titles, returning JSON output that lists groups of duplicate-titled notes with their IDs and modification dates.
bear_find_duplicates: { tool: { name: "bear_find_duplicates", description: "Find notes with duplicate titles. Returns groups of notes sharing the same title with their IDs and modification dates. Useful for cleaning up after imports or sync conflicts.", inputSchema: { type: "object" as const, properties: {}, }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, buildArgs: () => ["duplicates", "--json"], }, - mcp-server/src/tools.ts:715-718 (schema)The input schema for bear_find_duplicates defines an empty 'properties' object, meaning no input parameters are required.
inputSchema: { type: "object" as const, properties: {}, }, - mcp-server/src/tools.ts:9-9 (registration)The 'bear_find_duplicates' tool is registered as a property of the exported 'tools' record, which is imported by index.ts and exposed via the MCP ListToolsRequestSchema handler.
export const tools: Record<string, ToolHandler> = { - mcp-server/src/bcli.ts:256-268 (helper)The execBcliWithReauth function executes the bcli command built by the handler, with automatic re-authentication on auth errors.
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; } }