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
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes | The unique identifier of the note (ZUNIQUEIDENTIFIER) | |
| text | Yes | Text to add | |
| mode | No | Where to add text | append |
| open_note | No | Open the note in Bear after modification |
Implementation Reference
- src/mcp_bear/bear_url.py:68-97 (handler)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" - src/mcp_bear/server.py:111-129 (registration)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", - src/mcp_bear/server.py:333-343 (handler)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))]