Skip to main content
Glama
bigjeager

Bear App MCP Server

by bigjeager

bear_add_file

Add a file to an existing note in Bear App, specify the file path, target header, and insertion mode with options like append, prepend, or replace. Customize filename and control note visibility or editing.

Instructions

Add a file to an existing note

Input Schema

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

Input Schema (JSON Schema)

{ "properties": { "edit": { "description": "Place cursor in note editor", "type": "boolean" }, "file": { "description": "File path to add", "type": "string" }, "filename": { "description": "Custom filename for the file", "type": "string" }, "header": { "description": "Add file to specific header", "type": "string" }, "id": { "description": "Note unique identifier", "type": "string" }, "mode": { "description": "How to add the file", "enum": [ "append", "prepend", "replace_all", "replace" ], "type": "string" }, "new_window": { "description": "Open in new window", "type": "boolean" }, "open_note": { "description": "Open note after adding file", "type": "boolean" }, "selected": { "description": "Selected text in note", "type": "string" }, "show_window": { "description": "Show Bear window", "type": "boolean" }, "title": { "description": "Note title", "type": "string" } }, "required": [ "file" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'bear_add_file' tool. It processes input arguments, builds a Bear 'add-file' callback URL using shared utilities, executes it, and returns a success 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, types, descriptions, and required fields.
    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)
    Tool registration in the ListTools response, including name, description, and schema.
    { 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)
    Handler dispatch registration in the CallToolRequestSchema switch statement, mapping the tool name to its handler method.
    case "bear_add_file": return await this.addFile(args);

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