Skip to main content
Glama
bigjeager

Bear App MCP Server

by bigjeager

bear_add_file

Add files to existing Bear notes by specifying file paths, insertion modes, and optional headers to organize content attachments.

Instructions

Add a file to an existing note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoNote unique identifier
titleNoNote title
selectedNoSelected text in note
fileYesFile path to add
headerNoAdd file to specific header
filenameNoCustom filename for the file
modeNoHow to add the file
open_noteNoOpen note after adding file
new_windowNoOpen in new window
show_windowNoShow Bear window
editNoPlace cursor in note editor

Implementation Reference

  • The handler function that implements the bear_add_file tool. It maps input arguments to Bear URL parameters, constructs the 'bear://x-callback-url/add-file' URL using buildBearURL, executes it with executeURL, and returns a confirmation message.
    private async addFile(args: any) {
      const params: Record<string, string | boolean> = {};
      
      if (args.id) params.id = args.id;
      if (args.title) params.title = args.title;
      if (args.selected) params.selected = args.selected;
      if (args.file) params.file = args.file;
      if (args.header) params.header = args.header;
      if (args.filename) params.filename = args.filename;
      if (args.mode) params.mode = args.mode;
      if (args.open_note) params.open_note = "yes";
      if (args.new_window) params.new_window = "yes";
      if (args.show_window) params.show_window = "yes";
      if (args.edit) params.edit = "yes";
    
      const url = this.buildBearURL("add-file", params);
      await this.executeURL(url);
    
      return {
        content: [
          {
            type: "text",
            text: `Added file to note in Bear${args.filename ? ` with filename: ${args.filename}` : ""}`
          }
        ]
      };
    }
  • Input schema definition for the bear_add_file tool, specifying properties and required 'file' parameter.
    inputSchema: {
      type: "object",
      properties: {
        id: {
          type: "string",
          description: "Note unique identifier"
        },
        title: {
          type: "string",
          description: "Note title"
        },
        selected: {
          type: "string",
          description: "Selected text in note"
        },
        file: {
          type: "string",
          description: "File path to add"
        },
        header: {
          type: "string",
          description: "Add file to specific header"
        },
        filename: {
          type: "string",
          description: "Custom filename for the file"
        },
        mode: {
          type: "string",
          enum: ["append", "prepend", "replace_all", "replace"],
          description: "How to add the file"
        },
        open_note: {
          type: "boolean",
          description: "Open note after adding file"
        },
        new_window: {
          type: "boolean",
          description: "Open in new window"
        },
        show_window: {
          type: "boolean",
          description: "Show Bear window"
        },
        edit: {
          type: "boolean",
          description: "Place cursor in note editor"
        }
      },
      required: ["file"]
    }
  • src/index.ts:391-445 (registration)
    Registration of the bear_add_file tool in the list of available tools returned by ListToolsRequestSchema.
    {
      name: "bear_add_file",
      description: "Add a file to an existing note",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "Note unique identifier"
          },
          title: {
            type: "string",
            description: "Note title"
          },
          selected: {
            type: "string",
            description: "Selected text in note"
          },
          file: {
            type: "string",
            description: "File path to add"
          },
          header: {
            type: "string",
            description: "Add file to specific header"
          },
          filename: {
            type: "string",
            description: "Custom filename for the file"
          },
          mode: {
            type: "string",
            enum: ["append", "prepend", "replace_all", "replace"],
            description: "How to add the file"
          },
          open_note: {
            type: "boolean",
            description: "Open note after adding file"
          },
          new_window: {
            type: "boolean",
            description: "Open in new window"
          },
          show_window: {
            type: "boolean",
            description: "Show Bear window"
          },
          edit: {
            type: "boolean",
            description: "Place cursor in note editor"
          }
        },
        required: ["file"]
      }
    },
  • src/index.ts:711-712 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement that routes to the addFile handler.
    case "bear_add_file":
      return await this.addFile(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states the tool adds a file but doesn't describe what happens during the operation (e.g., whether it modifies the note content, requires specific permissions, has rate limits, or what happens on failure). For a mutation tool with 11 parameters and no annotations, this is a significant gap in behavioral context.

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 a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, with every word earning its place. There's zero waste or redundancy in the phrasing.

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

Completeness2/5

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

Given the tool's complexity (11 parameters, mutation operation), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or behavioral nuances. The agent would need to rely heavily on the input schema alone, which isn't sufficient for understanding the full context of this file addition operation.

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%, so the schema already documents all 11 parameters thoroughly with descriptions and an enum for 'mode'. The description adds no additional parameter semantics beyond what's in the schema. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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

Purpose4/5

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

The description clearly states the action ('Add a file') and target ('to an existing note'), providing a specific verb+resource combination. It distinguishes from sibling tools like bear_add_text (which adds text rather than files) and bear_create_note (which creates new notes rather than modifying existing ones). However, it doesn't explicitly mention how it differs from all siblings, keeping it from a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the note must already exist), when not to use it, or suggest alternative tools like bear_add_text for adding text content instead of files. The agent must infer usage from the tool name and parameters alone.

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/bigjeager/bear-mcp-server'

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