Skip to main content
Glama
madebygps

Obsidian Diary MCP Server

by madebygps

read_diary_entry

Retrieve specific diary entries from your Obsidian journal by date to review past reflections and maintain consistent journaling habits.

Instructions

Read an existing diary entry.

Args: date: Date of the entry in YYYY-MM-DD format

Returns: The diary entry content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'read_diary_entry' tool. Parses the date parameter, constructs the file path, checks if the entry exists, and reads the content using the entry_manager helper.
    def read_diary_entry(
        date: Annotated[str, "Date of the entry in YYYY-MM-DD format"]
    ) -> str:
        """Read a specific diary entry by date."""
        try:
            entry_date = datetime.strptime(date, "%Y-%m-%d")
        except ValueError:
            return "Error: Date must be in YYYY-MM-DD format"
    
        file_path = entry_manager.get_entry_path(entry_date)
    
        if not entry_manager.entry_exists(entry_date):
            return f"No memory log found for {date}"
    
        return entry_manager.read_entry(file_path)
  • Registers the 'read_diary_entry' tool with MCP using the @mcp.tool decorator, including metadata annotations.
    @mcp.tool(
        annotations={
            "title": "Read Memory Log",
            "readOnlyHint": True,
            "openWorldHint": False
        }
    )
  • Supporting method in EntryManager class that performs the actual file reading operation called by the tool handler.
    def read_entry(self, file_path: Path) -> str:
        """Read the content of a diary entry file."""
        try:
            return file_path.read_text(encoding="utf-8")
        except (FileNotFoundError, PermissionError, OSError) as e:
            return f"Error reading file: {e}"
  • Helper method used by the tool to check if the diary entry file exists before attempting to read it.
    def entry_exists(self, date: datetime) -> bool:
        """Check if an entry exists for the given date."""
        filename = date.strftime("%Y-%m-%d")
        file_path = self.diary_path / f"{filename}.md"
        return file_path.exists()
  • Helper method used by the tool to construct the file path from the input date.
    def get_entry_path(self, date: datetime) -> Path:
        """Get the file path for an entry on the given date."""
        filename = date.strftime("%Y-%m-%d")
        return self.diary_path / f"{filename}.md"
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 states this is a read operation but doesn't mention error handling (e.g., what happens if the entry doesn't exist), authentication needs, rate limits, or other behavioral traits. This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. The Args and Returns sections are structured clearly, though the formatting could be more integrated. There's minimal waste, earning a high score.

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's low complexity (one parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. However, it lacks behavioral context (e.g., error cases) and usage guidelines, which are important for completeness despite the simple schema.

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

Parameters4/5

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

The description adds meaningful context beyond the input schema, which has 0% description coverage. It specifies that the 'date' parameter should be in 'YYYY-MM-DD format', clarifying the expected syntax. With only one parameter, this is sufficient for a high score, though it doesn't cover edge cases like invalid dates.

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 ('Read') and resource ('an existing diary entry'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_recent_entries' or 'save_diary_entry', which prevents 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 like 'list_recent_entries' or 'save_diary_entry'. It lacks context about prerequisites (e.g., entry must exist) or exclusions, leaving usage decisions ambiguous.

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/madebygps/obsidian-diary-mcp'

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