Skip to main content
Glama

obsidian_append_content

Append content to existing Obsidian notes or create new files to add thoughts, references, and connections in Zettelkasten workflows.

Instructions

Append content to the end of an existing file or create new file.

Quick way to add content to notes. Useful for adding new thoughts, references, or connections to existing Zettelkasten notes. Args: params (AppendContentInput): Contains: - filepath (str): Path to file - content (str): Content to append Returns: str: Success message with updated file info Example: Add a new related concept to an existing note.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Implementation Reference

  • MCP tool registration and handler function for 'obsidian_append_content'. Calls obsidian_client.append_to_file to append content to Obsidian vault file.
    @mcp.tool( name="obsidian_append_content", annotations={ "title": "Append Content to File", "readOnlyHint": False, "destructiveHint": False, "idempotentHint": False, "openWorldHint": False } ) async def append_content(params: AppendContentInput) -> str: """Append content to the end of an existing file or create new file. Quick way to add content to notes. Useful for adding new thoughts, references, or connections to existing Zettelkasten notes. Args: params (AppendContentInput): Contains: - filepath (str): Path to file - content (str): Content to append Returns: str: Success message with updated file info Example: Add a new related concept to an existing note. """ try: result = await obsidian_client.append_to_file(params.filepath, params.content) return json.dumps({ "success": True, "message": "Content appended successfully", "filepath": params.filepath }, indent=2) except ObsidianAPIError as e: return json.dumps({ "error": str(e), "filepath": params.filepath, "success": False }, indent=2)
  • Pydantic input schema for the obsidian_append_content tool defining filepath and content parameters.
    class AppendContentInput(BaseModel): """Input for appending content to files.""" model_config = ConfigDict(str_strip_whitespace=True, extra='forbid') filepath: str = Field( description="Path to the file to append to", min_length=1, max_length=500 ) content: str = Field( description="Content to append to the file", min_length=1, max_length=50000 )
  • Helper method in ObsidianClient that implements the append logic: reads existing content, appends new content, writes back or creates new file.
    async def append_to_file(self, filepath: str, content: str) -> Dict[str, Any]: """Append content to an existing file or create new file.""" try: existing_content = await self.read_file(filepath) new_content = existing_content + "\n" + content if existing_content else content return await self.write_file(filepath, new_content) except ObsidianAPIError: # File doesn't exist, create it return await self.write_file(filepath, content)

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/Shepherd-Creative/obsidian-mcp'

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