Skip to main content
Glama

append_to_note

Add new content to existing notes in your Obsidian vault, enabling continuous updates and expansion of your knowledge base without creating duplicate files.

Instructions

Append content to an existing note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
pathYes

Implementation Reference

  • MCP tool handler function for 'append_to_note'. Validates inputs, calls vault.append_to_note, handles errors and returns formatted response.
    @mcp.tool(name="append_to_note", description="Append content to an existing note") async def append_to_note(path: str, content: str) -> str: """ Append content to the end of an existing note. Args: path: Relative path to the note content: Content to append Returns: Success message """ if not path or not path.strip(): return "Error: Path cannot be empty" if len(path) > 1000: return "Error: Path too long" if len(content) > 1_000_000: return "Error: Content too large (max 1MB)" context = _get_context() try: await context.vault.append_to_note(path, content) return f"✓ Appended to note: {path}" except FileNotFoundError: return f"Error: Note not found: {path}" except VaultSecurityError as e: return f"Error: Security violation: {e}" except Exception as e: logger.exception(f"Error appending to note {path}") return f"Error appending to note: {e}"
  • Core vault method that implements appending content to a note: validates path security, reads existing content, appends with proper newline handling, and writes back.
    async def append_to_note(self, relative_path: str, content: str) -> None: """ Append content to an existing note. Args: relative_path: Path to the note content: Content to append Raises: VaultSecurityError: If path is invalid FileNotFoundError: If note doesn't exist """ file_path = self._validate_path(relative_path) if not file_path.exists(): raise FileNotFoundError(f"Note not found: {relative_path}") # Read existing content async with aiofiles.open(file_path, encoding="utf-8") as f: existing = await f.read() # Append new content (with newline separator if needed) if not existing.endswith("\n"): existing += "\n" existing += content # Write back async with aiofiles.open(file_path, "w", encoding="utf-8") as f: await f.write(existing) logger.info(f"Appended to note: {relative_path}")
  • @mcp.tool decorator registering the 'append_to_note' tool with FastMCP.
    @mcp.tool(name="append_to_note", description="Append content to an existing note")

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/getglad/obsidian_mcp'

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