Skip to main content
Glama

get_daily_note_path

Retrieve the file path for today's or a specified date's daily note to open in Obsidian or check its existence.

Instructions

Get the file path to today's (or specified) daily note.

Useful for opening the note in Obsidian or checking if it exists.

Args: date_str: Optional date in YYYY-MM-DD format (defaults to today)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_strNo

Implementation Reference

  • The primary handler function in the logic layer that coordinates retrieving the vault and formatting the daily note path.
    async def get_daily_note_path(date_str: str = None) -> str:
        """Get the file path to today's (or specified) daily note.
    
        Args:
            date_str: Optional date in YYYY-MM-DD format (defaults to today)
    
        Returns:
            Path and existence status
        """
        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()
    
        note_path = vault.get_daily_note_path(date)
        exists = note_path.exists()
    
        result = f"📄 Daily note path: {note_path}\n"
        result += f"Status: {'✅ Exists' if exists else '❌ Does not exist'}\n"
    
        if not exists:
            result += "\nWant me to create it? Just ask: 'Create my daily note'"
    
        return result
  • The core implementation method within the Obsidian vault class that constructs the absolute path to the daily note file.
    def get_daily_note_path(self, date: datetime = None) -> Path:
        """Get path to a daily note.
    
        Args:
            date: Date for the note (defaults to today)
    
        Returns:
            Path to the daily note file
        """
        if date is None:
            date = datetime.now()
    
        date_str = date.strftime("%Y-%m-%d")
        note_path = self.daily_notes_format.replace("{date}", date_str)
        return self.vault_path / note_path
  • The server-side endpoint handler for the MCP tool that delegates to the daily_notes module.
    async def get_daily_note_path(date_str: str = None) -> str:
        """Get the file path to today's (or specified) daily note.
    
        Useful for opening the note in Obsidian or checking if it exists.
    
        Args:
            date_str: Optional date in YYYY-MM-DD format (defaults to today)
        """
        return await daily_notes.get_daily_note_path(date_str)

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/94aharris/coach-ai'

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