Skip to main content
Glama

bear_attach_file

Attach files or images to Bear notes, uploading to iCloud and embedding in markdown. Insert at the end, before or after specific text, or after the title.

Instructions

Attach a file or image to an existing Bear note. The file is uploaded to iCloud and embedded in the note's markdown. Supports common image formats (jpg, png, gif, webp, heic) and other file types (pdf, zip, etc.). By default the attachment is appended to the end. Use 'after' or 'before' to place it relative to text in the note, or 'prepend' to put it right after the title.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesNote ID (uniqueIdentifier)
file_pathYesAbsolute path to the file to attach
afterNoInsert after the line containing this text
beforeNoInsert before the line containing this text
prependNoInsert after the title line instead of at the end

Implementation Reference

  • Input schema for bear_attach_file tool: requires 'id' (note ID) and 'file_path' (absolute path to file). Optional: 'after', 'before' (string-based positioning), and 'prepend' (boolean for title-adjacent placement).
    inputSchema: {
      type: "object" as const,
      properties: {
        id: {
          type: "string",
          description: "Note ID (uniqueIdentifier)",
        },
        file_path: {
          type: "string",
          description:
            "Absolute path to the file to attach",
        },
        after: {
          type: "string",
          description:
            "Insert after the line containing this text",
        },
        before: {
          type: "string",
          description:
            "Insert before the line containing this text",
        },
        prepend: {
          type: "boolean",
          description:
            "Insert after the title line instead of at the end",
        },
      },
      required: ["id", "file_path"],
    },
  • Command builder for bear_attach_file. Constructs the bcli CLI arguments: calls the 'attach' subcommand with note ID and file path, plus optional --after, --before, --prepend flags.
    buildArgs: (input) => {
      const args = [
        "attach",
        String(input.id),
        String(input.file_path),
        "--json",
      ];
      if (input.after) args.push("--after", String(input.after));
      if (input.before) args.push("--before", String(input.before));
      if (input.prepend) args.push("--prepend");
      return args;
    },
  • Registration of the bear_attach_file tool in the tools dictionary. Maps the tool name to a ToolHandler object containing the tool metadata (name, description, inputSchema, annotations) and the buildArgs function.
    bear_attach_file: {
      tool: {
        name: "bear_attach_file",
        description:
          "Attach a file or image to an existing Bear note. The file is uploaded to iCloud and embedded in the note's markdown. Supports common image formats (jpg, png, gif, webp, heic) and other file types (pdf, zip, etc.). By default the attachment is appended to the end. Use 'after' or 'before' to place it relative to text in the note, or 'prepend' to put it right after the title.",
        inputSchema: {
          type: "object" as const,
          properties: {
            id: {
              type: "string",
              description: "Note ID (uniqueIdentifier)",
            },
            file_path: {
              type: "string",
              description:
                "Absolute path to the file to attach",
            },
            after: {
              type: "string",
              description:
                "Insert after the line containing this text",
            },
            before: {
              type: "string",
              description:
                "Insert before the line containing this text",
            },
            prepend: {
              type: "boolean",
              description:
                "Insert after the title line instead of at the end",
            },
          },
          required: ["id", "file_path"],
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
        },
      },
      buildArgs: (input) => {
        const args = [
          "attach",
          String(input.id),
          String(input.file_path),
          "--json",
        ];
        if (input.after) args.push("--after", String(input.after));
        if (input.before) args.push("--before", String(input.before));
        if (input.prepend) args.push("--prepend");
        return args;
      },
    },
Behavior4/5

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

Annotations indicate non-readonly, non-destructive, non-idempotent. Description adds critical context: file uploaded to iCloud, embedded in markdown, and placement behavior, which is beyond annotation coverage.

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?

Four sentences front-loaded with main action. No wasted words, well-structured, and efficient.

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?

Covers purpose, file types, placement, and side effects (iCloud). With no output schema, could mention return value, but sufficient for agent to use correctly.

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 has 100% description coverage. Description adds meaning by explaining placement options (after/before relative to text, prepend) and supported file types, complementing schema.

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?

Description clearly states 'Attach a file or image to an existing Bear note' with specific verb and resource, and adds context on iCloud uploading and markdown embedding. This distinguishes it from siblings like bear_create_note or bear_edit_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?

Explains default behavior (appended to end) and when to use placement parameters (after, before, prepend). Could explicitly mention prerequisites like file existence, but guidance is clear.

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