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);

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