Skip to main content
Glama

list_daily_notes

Retrieve recent daily notes from your Obsidian vault to track daily activities and maintain organized documentation.

Instructions

List recent daily notes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoDaily Notes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core handler function implementing the logic to list recent daily notes by filtering notes with YYYY-MM-DD.md filenames within the specified days_back, sorting by modification time (newest first), and limiting the results.
    def list_daily_notes(
        self, folder: str = "Daily Notes", limit: int = 30, days_back: int = 90
    ) -> list[NoteMetadata]:
        """
        List recent daily notes.
    
        Args:
            folder: Folder where daily notes are stored
            limit: Maximum number of notes to return
            days_back: How many days back to search
    
        Returns:
            List of daily notes sorted by date (newest first)
        """
        notes = self.list_notes(folder=folder, recursive=False, limit=None)
    
        # Filter to date-formatted notes (YYYY-MM-DD.md)
        date_pattern = re.compile(r"^\d{4}-\d{2}-\d{2}\.md$")
        daily_notes = []
    
        cutoff_date = date.today() - timedelta(days=days_back)
    
        for note in notes:
            filename = Path(note.path).name
    
            if date_pattern.match(filename):
                # Parse date from filename
                try:
                    note_date = datetime.strptime(filename[:-3], "%Y-%m-%d").date()
                    if note_date >= cutoff_date:
                        daily_notes.append(note)
                except ValueError:
                    continue
    
        # Sort by modification time (newest first)
        daily_notes.sort(key=lambda n: n.modified, reverse=True)
    
        return daily_notes[:limit]
  • MCP tool registration with @mcp.tool decorator. Wrapper function that calls the vault handler, handles errors, and formats the output as a human-readable string list.
    @mcp.tool(name="list_daily_notes", description="List recent daily notes")
    def list_daily_notes(folder: str = "Daily Notes", limit: int = 30) -> str:
        """
        List recent daily notes.
    
        Args:
            folder: Folder where daily notes are stored
            limit: Maximum number of notes (default: 30)
    
        Returns:
            Formatted list of daily notes
        """
        if limit <= 0 or limit > 365:
            return "Error: Limit must be between 1 and 365"
    
        context = _get_context()
    
        try:
            notes = context.vault.list_daily_notes(folder, limit)
    
            if not notes:
                return f"No daily notes found in '{folder}'"
    
            output = f"Found {len(notes)} daily note(s) in '{folder}':\n\n"
            for i, note in enumerate(notes, 1):
                output += f"{i}. **{note.name}**\n"
                output += f"   Path: `{note.path}`\n"
                output += f"   Size: {note.size} bytes\n\n"
    
            return output
    
        except Exception as e:
            logger.exception("Error listing daily notes")
            return f"Error listing daily notes: {e}"
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits like whether it's read-only, if it requires authentication, rate limits, or how 'recent' is defined (e.g., by date or count). It mentions 'recent' but doesn't clarify if this is based on creation date, modification, or another criterion.

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 with a single phrase 'List recent daily notes', which is front-loaded and wastes no words. Every part of the sentence contributes to the core purpose, making it efficient and easy to parse.

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 handles return values), 2 parameters with low schema coverage, and no annotations, the description is minimally adequate but incomplete. It states what the tool does but lacks details on behavior, parameter usage, and differentiation from siblings, leaving gaps for the agent to navigate.

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?

The input schema has 2 parameters with 0% description coverage, so the description must compensate but adds no parameter details. It doesn't explain what 'folder' or 'limit' mean, their defaults, or how they affect the listing. Since there are parameters, the baseline is not automatically 4, and the description fails to provide meaningful semantics beyond the 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 'List recent daily notes' clearly states the verb ('List') and resource ('daily notes'), but lacks specificity about what constitutes 'recent' and doesn't differentiate from sibling tools like 'list_notes' or 'get_daily_note'. It's better than a tautology but remains vague in scope.

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 'list_notes', 'get_daily_note', or 'search_notes'. The description implies a focus on daily notes but doesn't specify context, prerequisites, or exclusions, leaving the agent to infer usage.

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