Skip to main content
Glama

bear_context_sync

Idempotent

Syncs qualifying Bear notes to the local context library, updating changed notes and removing outdated ones to keep the curated knowledge base current.

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

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce full re-sync (re-download all notes)

Implementation Reference

  • Tool registration in the 'tools' record with tool definition (name, description, inputSchema, annotations) and buildArgs that constructs CLI arguments ['context', 'sync', '--json'] with optional '--force' flag. The handler is not a separate function -- the tool's logic is entirely contained in the registration object itself (buildArgs method).
    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;
      },
    },
  • Input schema for bear_context_sync: accepts a single optional boolean parameter 'force'.
    inputSchema: {
      type: "object" as const,
      properties: {
        force: {
          type: "boolean",
          description: "Force full re-sync (re-download all notes)",
        },
      },
  • Helper that executes the bcli CLI with the arguments ['context', 'sync', '--json', '--force'?] built by the tool 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;
      }
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds details beyond annotations: adds/updates/removes notes, regenerates index, scoped to bear/ directory. Annotations already indicate idempotent, non-destructive, non-read-only. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four concise sentences, each essential. No fluff, front-loaded with purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers action, scope, and usage. Minor gap: does not define 'qualifying notes', but overall sufficient for a low-complexity tool with one optional parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with clear description for 'force'. Description adds no extra meaning beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Sync' and resource 'qualifying Bear notes to local context library'. Distinguishes from siblings like bear_sync and bear_context_* by specifying it only touches bear/ directory and regenerates index.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Call this when the user asks to sync, refresh, or update their context.' No when-not-to-use but implies alternatives like individual context tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mreider/better-bear'

If you have feedback or need assistance with the MCP directory API, please join our Discord server