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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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")
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose permissions needed, whether appending is reversible, rate limits, or how it handles errors (e.g., if the note doesn't exist). This is inadequate for a mutation tool with zero 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?

The description is a single, efficient sentence with no wasted words, making it easy to parse. It's appropriately sized for the tool's complexity and front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a mutation tool with no annotations, 0% schema coverage, but an output schema exists, the description is incomplete. It covers the basic purpose but lacks usage guidelines, parameter details, and behavioral context. The output schema mitigates some gaps, but overall it's minimal for a tool with siblings and operational complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only implies parameters ('content' and 'path' from context) without explaining their semantics. It doesn't clarify what 'path' refers to (e.g., file path, note ID) or 'content' format (e.g., text, markdown). Baseline is 3 due to 0% coverage, but it adds minimal value beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Append content to an existing note' clearly states the action (append) and resource (note), but it's vague about scope and doesn't differentiate from siblings like 'update_note' or 'batch_append_notes'. It specifies 'existing' note but lacks details on format or limitations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'update_note' for modifications or 'create_note' for new notes. The description implies it's for appending to existing notes but doesn't mention prerequisites, exclusions, or sibling tools like 'batch_append_notes' for multiple operations.

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

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