Skip to main content
Glama
madebygps

Obsidian Diary MCP Server

by madebygps

update_entry_backlinks

Update backlinks for diary entries by analyzing current content to automatically connect related journal entries in your Obsidian vault.

Instructions

Update the backlinks for an existing diary entry based on its current content.

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

Returns: Success message with updated backlinks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function that executes the tool logic: parses date, reads diary entry, finds related entries and themes, adds Obsidian-compatible memory links, updates the file, and returns status.
    async def update_entry_backlinks(
        date: Annotated[str, "Date of the entry in YYYY-MM-DD format"]
    ) -> str:
        """Update the backlinks for an existing diary entry based on its current content."""
        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}"
    
        content = entry_manager.read_entry(file_path)
        related = await analysis_engine.find_related_entries(content, exclude_date=date)
    
        themes = await analysis_engine.extract_themes_and_topics(content)
        topic_tags = analysis_engine.generate_topic_tags(themes)
        
        content = entry_manager.add_memory_links(content, related, topic_tags)
    
        if entry_manager.write_entry(file_path, content):
            connection_types = [f"{len(related)} temporal"] if related else []
            if topic_tags:
                connection_types.append(f"{len(topic_tags)} topic tags")
            
            connections_str = " + ".join(connection_types) if connection_types else "none found"
            
            return (
                f"**Memory links updated** for {date}\n\n**Connections:** {connections_str}\n\n**Obsidian power:** Use Backlinks panel for temporal connections, Tags panel for topics, Graph view for visual exploration!"
            )
        else:
            return "Error updating entry: Permission denied or I/O error"
  • The @mcp.tool decorator that registers 'update_entry_backlinks' with the FastMCP server, including tool metadata and behavioral hints.
    @mcp.tool(
        annotations={
            "title": "Refresh Memory Links",
            "destructiveHint": False,
            "idempotentHint": False,
            "openWorldHint": False
        }
    )
  • Input schema definition using Pydantic Annotated type for the date parameter.
        date: Annotated[str, "Date of the entry in YYYY-MM-DD format"]
    ) -> str:
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 the tool updates backlinks based on content, implying a mutation operation, but fails to address critical aspects such as required permissions, whether changes are reversible, or any rate limits. This leaves significant gaps in understanding the tool's 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 well-structured and front-loaded, with the core purpose stated first, followed by clear sections for 'Args' and 'Returns.' Every sentence adds value without redundancy, 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's complexity (a mutation with no annotations), the description is moderately complete. It covers the purpose and parameter semantics adequately, and the presence of an output schema means return values need not be detailed. However, it lacks usage guidelines and sufficient behavioral transparency, leaving gaps for an AI agent to fully understand when and how to invoke it correctly.

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 schema description coverage is 0%, so the description must compensate. It adds meaningful context: the 'date' parameter is explained as 'Date of the entry in YYYY-MM-DD format,' which clarifies its purpose beyond the bare schema. Since there is only one parameter, this is sufficient to earn a high score, though not a 5 due to lack of deeper semantic details (e.g., timezone handling).

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: 'Update the backlinks for an existing diary entry based on its current content.' It specifies the verb ('Update'), resource ('backlinks'), and scope ('existing diary entry'), but does not explicitly differentiate it from sibling tools like 'save_diary_entry' or 'read_diary_entry', which prevents a score of 5.

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. It does not mention prerequisites (e.g., entry must exist), exclusions, or compare it to siblings like 'save_diary_entry' (which might handle content updates). This lack of contextual direction limits its utility for an AI agent.

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