Skip to main content
Glama

bear_context_push_to_bear

Idempotent

Converts external files to permanent Bear notes by creating a new note from file content, tagging it as #context (with optional subtag), and deleting the original file. Ideal for archiving matured external content into Bear.

Instructions

Push an external file to Bear as a new note. Creates a Bear note from the file content, tags it with #context (+ optional subtag), and removes the original external file. Use when external content has matured enough to become a permanent Bear note.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesFilename in external/ to push
subtagNoSub-tag (e.g., 'architecture' → #context/architecture)
titleNoOverride note title (defaults to title extracted from content)

Implementation Reference

  • The full implementation of the bear_context_push_to_bear tool. It defines the tool metadata (name, description, inputSchema with required filename and optional subtag/title), annotations, and the buildArgs function that constructs the CLI args ['context', 'push', filename, '--json'] with optional --subtag and --title flags.
    bear_context_push_to_bear: {
      tool: {
        name: "bear_context_push_to_bear",
        description:
          "Push an external file to Bear as a new note. Creates a Bear note from the file content, tags it with #context (+ optional subtag), and removes the original external file. Use when external content has matured enough to become a permanent Bear note.",
        inputSchema: {
          type: "object" as const,
          properties: {
            filename: {
              type: "string",
              description: "Filename in external/ to push",
            },
            subtag: {
              type: "string",
              description:
                "Sub-tag (e.g., 'architecture' → #context/architecture)",
            },
            title: {
              type: "string",
              description:
                "Override note title (defaults to title extracted from content)",
            },
          },
          required: ["filename"],
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
        },
      },
      buildArgs: (input) => {
        const args = ["context", "push", String(input.filename), "--json"];
        if (input.subtag) args.push("--subtag", String(input.subtag));
        if (input.title) args.push("--title", String(input.title));
        return args;
      },
    },
  • The tool is registered into the MCP server via the tools map exported from tools.ts. ListToolsRequestSchema exposes all tool definitions, and CallToolRequestSchema dispatches to the handler by name.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.values(tools).map((t) => t.tool),
    }));
  • The execution logic: handler.buildArgs(params) produces the arguments, then execBcliWithReauth runs the bcli CLI with those args (this tool does not use stdin).
    try {
      const args = handler.buildArgs(params);
      let result: { stdout: string; stderr: string };
    
      // Check if this tool needs stdin piping
      const stdinData = handler.usesStdin?.(params) ?? null;
      if (stdinData !== null) {
        result = await execBcliWithStdinAndReauth(args, stdinData);
      } else {
        result = await execBcliWithReauth(args);
      }
Behavior1/5

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

The description states the tool 'removes the original external file,' which is a destructive action. However, annotations set destructiveHint=false, creating a clear contradiction. The description also fails to disclose other behaviors like idempotency issues (file already removed) or permissions needed.

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 sentences: a concise summary, a detailed explanation, and a usage guideline. All sentences are informative with no wasted words. It is well-structured and front-loaded.

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?

Given no output schema and full parameter coverage, the description covers the tool's purpose, mechanism, and usage context adequately. However, it misses return value information (e.g., note ID) and the annotation contradiction reduces overall completeness.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds meaning by explaining the subtag creates '#context/subtag' and the title parameter overrides the default. This goes beyond the schema's basic descriptions.

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 pushes an external file to Bear as a new note, tags it with #context, and removes the original file. This distinguishes it from siblings like bear_create_note (which doesn't handle external files) and bear_context_add (which adds to context without creating a note).

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 includes a specific usage guideline: 'Use when external content has matured enough to become a permanent Bear note.' This provides clear context, though it does not explicitly contrast with alternatives like bear_context_ingest or bear_context_remove_external.

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/KuvopLLC/better-bear'

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