write_daily_note_section
Add or update content in specific sections of daily notes for tracking summaries, insights, and reflections with optional date selection and append/replace functionality.
Instructions
Write or append content to a specific section in the daily note.
Use this to add summaries, insights, reflections, or any other content to specific sections of your daily note.
Args: section: Name of the section to write to (e.g., "Notes", "Coach AI Insights") content: Content to write date_str: Optional date in YYYY-MM-DD format (defaults to today) append: If True, append to existing content. If False, replace it.
Returns: Confirmation message
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| section | Yes | ||
| content | Yes | ||
| date_str | No | ||
| append | No |
Implementation Reference
- src/coach_ai/daily_notes.py:491-524 (handler)The implementation of the write_daily_note_section tool, which uses an Obsidian vault instance to write or append content to a specific section in a daily note.
async def write_daily_note_section( section: str, content: str, date_str: str = None, append: bool = True ) -> str: """Write or append content to a specific section in the daily note. Args: section: Name of the section to write to content: Content to write date_str: Optional date in YYYY-MM-DD format (defaults to today) append: If True, append to existing content. If False, replace it. Returns: Confirmation message """ vault = get_vault() if not vault: return "❌ Obsidian vault not configured." if date_str: try: date = datetime.strptime(date_str, "%Y-%m-%d") except ValueError: return f"❌ Invalid date format: {date_str}" else: date = datetime.now() success = vault.write_to_section(date, section, content, append=append) if not success: return f"❌ Failed to write to section '{section}'. Section may not exist." action = "Appended to" if append else "Updated" return f"✅ {action} section '{section}' in daily note for {date.strftime('%Y-%m-%d')}." - src/coach_ai/server.py:757-774 (registration)The tool registration for 'write_daily_note_section' in the Coach AI MCP server, which acts as a wrapper around the daily_notes.write_daily_note_section function.
async def write_daily_note_section( section: str, content: str, date_str: str = None, append: bool = True ) -> str: """Write or append content to a specific section in the daily note. Use this to add summaries, insights, reflections, or any other content to specific sections of your daily note. Args: section: Name of the section to write to (e.g., "Notes", "Coach AI Insights") content: Content to write date_str: Optional date in YYYY-MM-DD format (defaults to today) append: If True, append to existing content. If False, replace it. Returns: Confirmation message """ return await daily_notes.write_daily_note_section(section, content, date_str, append)