Skip to main content
Glama

bear_sync

Idempotent

Trigger incremental or full sync of Bear notes from iCloud to ensure up-to-date data, though auto-sync typically handles cache staleness.

Instructions

Trigger a sync of Bear notes from iCloud. Normally an incremental sync fetching only changes. Use 'full' to force a complete re-sync. Most read operations auto-sync when the cache is stale, so manual sync is rarely needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullNoForce a full re-sync instead of incremental

Implementation Reference

  • Definition of the 'bear_sync' tool including its schema (input properties for 'full' boolean), description, and annotations. The buildArgs function constructs CLI args ['sync', '--json'] and optionally adds '--full' if the input.full flag is set.
    bear_sync: {
      tool: {
        name: "bear_sync",
        description:
          "Trigger a sync of Bear notes from iCloud. Normally an incremental sync fetching only changes. Use 'full' to force a complete re-sync. Most read operations auto-sync when the cache is stale, so manual sync is rarely needed.",
        inputSchema: {
          type: "object" as const,
          properties: {
            full: {
              type: "boolean",
              description: "Force a full re-sync instead of incremental",
            },
          },
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
        },
      },
      buildArgs: (input) => {
        const args = ["sync", "--json"];
        if (input.full) args.push("--full");
        return args;
      },
    },
  • All tools including bear_sync are registered via ListToolsRequestSchema handler which maps all tool definitions from tools.ts into MCP tool list.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.values(tools).map((t) => t.tool),
    }));
  • CallToolRequestSchema handler looks up the tool by name from the tools object and invokes its buildArgs function, which for bear_sync builds the 'sync --json' command.
    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,
        };
      }
  • execBcliWithReauth is the helper that executes the bcli command built by bear_sync's buildArgs (i.e., 'bcli sync --json' with optional '--full'), with automatic reauthentication 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;
      }
    }
Behavior5/5

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

Annotations indicate idempotentHint=true, destructiveHint=false, and readOnlyHint=false. The description aligns perfectly, explaining that an incremental sync is the norm and that a full re-sync is an option. It adds crucial context about auto-sync behavior, which is not captured in annotations, enhancing transparency.

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?

The description is three concise sentences, front-loaded with the core purpose, and every sentence adds value without fluff. It efficiently covers usage, parameter, and behavioral context.

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

Completeness5/5

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

Despite lacking an output schema, the description is complete for a simple sync tool with one optional parameter. It explains the sync behavior, frequency, and parameter options, enabling an agent to decide when to invoke it without ambiguity.

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

Parameters5/5

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

Schema coverage is 100% with one boolean parameter described. The description clarifies that the default is incremental and setting 'full' forces a complete re-sync, adding meaning beyond the schema's basic type definition.

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?

The description clearly states the tool triggers a sync of Bear notes from iCloud, distinguishes between incremental and full re-sync, and notes that manual sync is rarely needed due to auto-sync on read operations. It specifically identifies the resource (Bear notes) and action (sync), setting it apart from sibling tools like bear_context_sync.

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?

The description provides explicit context on when to use the tool (rarely needed) and when not to (most read operations auto-sync). It explains the 'full' parameter option for a complete re-sync, but does not explicitly name alternatives or exclusions beyond the auto-sync behavior, which is clear enough.

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