bear_find_duplicates
Identify notes with identical titles and view their IDs and modification dates. Remove duplicates after imports or resolve sync conflicts to keep your Bear notes organized.
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)Handler definition for bear_find_duplicates tool. buildArgs returns ['duplicates', '--json'] which gets executed via bcli CLI. The output JSON is parsed and returned. No input parameters required.
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/index.ts:34-35 (registration)Registration: tools object from tools.ts is imported and handlers are looked up by name in the CallToolRequestSchema handler. The buildArgs function is called with parsed input params, then executed via execBcliWithReauth.
const { name, arguments: input } = request.params; const handler = tools[name]; - mcp-server/src/index.ts:29-31 (registration)Tool listing registration: all tools including bear_find_duplicates are exposed via ListToolsRequestSchema by mapping over Object.values(tools).
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), })); - mcp-server/src/tools.ts:715-718 (schema)Schema: bear_find_duplicates takes no input parameters (empty properties object).
inputSchema: { type: "object" as const, properties: {}, }, - mcp-server/src/bcli.ts:256-268 (helper)Helper function that executes the bcli CLI with the buildArgs (['duplicates', '--json']) and handles re-authentication if needed.
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; } }