bear_context_sync
Sync qualifying Bear notes to the local context library, updating changed notes and removing disqualified ones. Use to refresh or update the context index.
Instructions
Sync qualifying Bear notes to the local context library. Adds new notes, updates changed notes, and removes notes that no longer qualify (tag removed, trashed, etc.). Regenerates the index. Only touches the bear/ directory — external/ and inbox/ are untouched. Call this when the user asks to sync, refresh, or update their context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Force full re-sync (re-download all notes) |
Implementation Reference
- mcp-server/src/tools.ts:789-814 (handler)The full ToolHandler definition for bear_context_sync, including the tool metadata (name, description, inputSchema, annotations) and the buildArgs function that constructs the CLI command ['context', 'sync', '--json'] with an optional '--force' flag.
bear_context_sync: { tool: { name: "bear_context_sync", description: "Sync qualifying Bear notes to the local context library. Adds new notes, updates changed notes, and removes notes that no longer qualify (tag removed, trashed, etc.). Regenerates the index. Only touches the bear/ directory — external/ and inbox/ are untouched. Call this when the user asks to sync, refresh, or update their context.", inputSchema: { type: "object" as const, properties: { force: { type: "boolean", description: "Force full re-sync (re-download all notes)", }, }, }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["context", "sync", "--json"]; if (input.force) args.push("--force"); return args; }, }, - mcp-server/src/tools.ts:789-814 (schema)The input schema for bear_context_sync defines a single optional boolean property 'force' to trigger a full re-sync.
bear_context_sync: { tool: { name: "bear_context_sync", description: "Sync qualifying Bear notes to the local context library. Adds new notes, updates changed notes, and removes notes that no longer qualify (tag removed, trashed, etc.). Regenerates the index. Only touches the bear/ directory — external/ and inbox/ are untouched. Call this when the user asks to sync, refresh, or update their context.", inputSchema: { type: "object" as const, properties: { force: { type: "boolean", description: "Force full re-sync (re-download all notes)", }, }, }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["context", "sync", "--json"]; if (input.force) args.push("--force"); return args; }, }, - mcp-server/src/tools.ts:9-9 (registration)The tool is registered as a property in the exported 'tools' Record<string, ToolHandler> object at key 'bear_context_sync'.
export const tools: Record<string, ToolHandler> = { - mcp-server/src/index.ts:33-41 (helper)The CallToolRequestSchema handler in index.ts looks up the tool by name from the tools registry and invokes its buildArgs method to construct the CLI command, then executes it via execBcliWithReauth.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: input } = request.params; const handler = tools[name]; if (!handler) { return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true, };