Skip to main content
Glama

get_daily_note

Access or create daily notes for specific dates in your Obsidian vault, maintaining organized documentation with automatic folder management and date-based retrieval.

Instructions

Get or create a daily note for a specific date

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
createNo
date_strNo
folderNoDaily Notes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function that exposes get_daily_note tool, parses args, calls vault method, and formats response.
    @mcp.tool(name="get_daily_note", description="Get or create a daily note for a specific date")
    async def get_daily_note(
        date_str: str = "", folder: str = "Daily Notes", create: bool = True
    ) -> str:
        """
        Get or create a daily note.
    
        Args:
            date_str: Date in YYYY-MM-DD format (empty for today)
            folder: Folder where daily notes are stored
            create: If true, create the note if it doesn't exist
    
        Returns:
            Daily note content
        """
        context = _get_context()
    
        try:
            # Parse date
            if date_str:
                target_date = datetime.strptime(date_str, "%Y-%m-%d").date()
            else:
                target_date = None
    
            note = await context.vault.get_daily_note(target_date, folder, create)
    
            result = f"# Daily Note: {note.path}\n\n"
            if note.frontmatter:
                result += "## Frontmatter\n```yaml\n"
                result += yaml.dump(note.frontmatter, default_flow_style=False)
                result += "```\n\n"
    
            result += "## Content\n"
            result += note.body
    
            return result
    
        except ValueError as e:
            return f"Error: Invalid date format (use YYYY-MM-DD): {e}"
        except FileNotFoundError:
            return f"Error: Daily note not found for {date_str}"
        except Exception as e:
            logger.exception("Error getting daily note")
            return f"Error getting daily note: {e}"
  • Core implementation in ObsidianVault class: computes path, reads existing or creates new daily note with default content/frontmatter.
    async def get_daily_note(
        self,
        target_date: date | None = None,
        folder: str = "Daily Notes",
        create_if_missing: bool = True,
    ) -> Note:
        """
        Get or create a daily note.
    
        Args:
            target_date: Date for the daily note (defaults to today)
            folder: Folder where daily notes are stored
            create_if_missing: If True, create the note if it doesn't exist
    
        Returns:
            Daily note
        """
        if target_date is None:
            target_date = date.today()
    
        note_path = self.get_daily_note_path(target_date, folder)
    
        # Try to read existing note
        try:
            return await self.read_note(note_path)
        except FileNotFoundError:
            if not create_if_missing:
                raise
    
            # Create new daily note
            frontmatter = {
                "date": target_date.strftime("%Y-%m-%d"),
                "tags": ["daily-note"],
            }
    
            content = f"# {target_date.strftime('%A, %B %d, %Y')}\n\n"
    
            self.create_note(note_path, content, frontmatter)
            return await self.read_note(note_path)
  • Helper method to generate the filename and path for a daily note based on date and folder.
    def get_daily_note_path(
        self, target_date: date | None = None, folder: str = "Daily Notes"
    ) -> str:
        """
        Get the path for a daily note.
    
        Args:
            target_date: Date for the daily note (defaults to today)
            folder: Folder where daily notes are stored
    
        Returns:
            Relative path to the daily note
        """
        if target_date is None:
            target_date = date.today()
    
        # Format: YYYY-MM-DD.md
        filename = f"{target_date.strftime('%Y-%m-%d')}.md"
    
        if folder:
            return f"{folder}/{filename}"
        return filename
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool can 'Get or create' a daily note, implying it may perform a write operation if creation is needed, but doesn't specify permissions required, whether creation is automatic or conditional, error handling, or response format. This is a significant gap for a tool with potential mutation behavior.

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 extremely concise—a single sentence that directly states the tool's purpose without any unnecessary words. It is front-loaded and efficiently communicates the core functionality, earning a perfect score for brevity and clarity.

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 the tool has an output schema (which should cover return values), the description's main gap is in parameter semantics and behavioral transparency. However, with no annotations and 0% schema coverage, the description is incomplete for a tool that might create resources. It's minimally adequate but lacks critical details for safe and effective use.

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

Parameters2/5

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

The schema description coverage is 0%, meaning parameters are undocumented in the schema. The description adds no information about the parameters (e.g., what 'date_str' format to use, what 'folder' represents, or how 'create' affects behavior). It fails to compensate for the lack of schema documentation, leaving parameters ambiguous.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Get or create') and resource ('daily note for a specific date'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'list_daily_notes' or 'read_note', which is why it doesn't reach a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't clarify when to use 'get_daily_note' instead of 'list_daily_notes' or 'read_note', or mention any prerequisites or exclusions, leaving the agent without usage context.

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