Skip to main content
Glama

add_text

Add text to existing notes in Bear Notes by appending, prepending, or replacing content using note identifiers and text input.

Instructions

Add text to an existing note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
note_idYesThe unique identifier of the note (ZUNIQUEIDENTIFIER)
textYesText to add
modeNoWhere to add textappend
open_noteNoOpen the note in Bear after modification

Implementation Reference

  • The actual implementation of the add_text function which constructs the URL for the Bear x-callback-url.
    def add_text(
        note_id: str,
        text: str,
        mode: str = "append",
        open_note: bool = False
    ) -> dict[str, str]:
        """
        Add text to an existing note.
    
        Args:
            note_id: The unique identifier of the note (ZUNIQUEIDENTIFIER)
            text: Text to add
            mode: Where to add text - "append", "prepend", or "replace"
            open_note: Open the note in Bear after modification
    
        Returns:
            Dictionary with operation result
        """
        if mode not in ["append", "prepend", "replace"]:
            return {"success": False, "error": f"Invalid mode: {mode}. Use append, prepend, or replace"}
    
        params = {
            "id": note_id,
            "text": text,
            "mode": mode
        }
    
        if open_note:
            params["open_note"] = "yes"
  • The MCP tool registration for 'add_text', including its input schema.
    Tool(
        name="add_text",
        description="Add text to an existing note",
        inputSchema={
            "type": "object",
            "properties": {
                "note_id": {
                    "type": "string",
                    "description": "The unique identifier of the note (ZUNIQUEIDENTIFIER)",
                },
                "text": {
                    "type": "string",
                    "description": "Text to add",
                },
                "mode": {
                    "type": "string",
                    "enum": ["append", "prepend", "replace"],
                    "description": "Where to add text",
                    "default": "append",
  • The MCP tool handler that parses arguments and calls the underlying add_text function.
    elif name == "add_text":
        if not isinstance(arguments, dict) or "note_id" not in arguments or "text" not in arguments:
            raise ValueError("Missing required arguments: note_id and text")
    
        result = add_text(
            note_id=arguments["note_id"],
            text=arguments["text"],
            mode=arguments.get("mode", "append"),
            open_note=arguments.get("open_note", False)
        )
        return [TextContent(type="text", text=str(result))]

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/maxim-ist/mcp-bear'

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