Skip to main content
Glama
brysontang

DeltaTask MCP Server

by brysontang

sync_tasks

Sync tasks from Obsidian markdown files into SQLite database for centralized task management.

Instructions

Sync tasks from Obsidian markdown into SQLite.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:59-62 (handler)
    The main handler function for the 'sync_tasks' MCP tool. It is registered via the @mcp.tool() decorator and delegates the sync logic to TaskService.sync_from_obsidian().
    @mcp.tool()
    async def sync_tasks() -> dict[str, Any]:
        """Sync tasks from Obsidian markdown into SQLite."""
        return service.sync_from_obsidian()
  • The core helper method in TaskService that implements the synchronization logic from Obsidian markdown files to the SQLite database, handling updates, additions, and error tracking.
    def sync_from_obsidian(self) -> Dict[str, Any]:
        """Sync changes from Obsidian markdown files back to the database."""
        logger.info("Starting sync from Obsidian to database")
        
        try:
            # Get all tasks from markdown files
            markdown_tasks = self.markdown_manager.sync_from_markdown()
            
            if not markdown_tasks:
                logger.info("No markdown tasks found for syncing")
                return {"message": "No tasks found for syncing", "count": 0}
            
            # Track statistics
            updated_count = 0
            error_count = 0
            
            # Process each task
            for task_data in markdown_tasks:
                try:
                    task_id = task_data["id"]
                    
                    # Check if task exists
                    existing_task = self.repository.get_todo_by_id(task_id)
                    
                    if existing_task:
                        # Update existing task
                        success = self.repository.update_todo(task_id, task_data)
                        if success:
                            logger.info(f"Updated task {task_id} from markdown")
                            updated_count += 1
                        else:
                            logger.error(f"Failed to update task {task_id} from markdown")
                            error_count += 1
                    else:
                        # Add new task
                        self.repository.add_todo(task_data)
                        logger.info(f"Added new task {task_id} from markdown")
                        updated_count += 1
                except Exception as e:
                    logger.error(f"Error syncing task {task_data.get('id', 'unknown')}: {e}", exc_info=True)
                    error_count += 1
            
            # Update all views to reflect changes
            try:
                self._update_all_views()
            except Exception as e:
                logger.error(f"Error updating views after sync: {e}", exc_info=True)
            
            result = {
                "message": "Sync completed",
                "updated": updated_count,
                "errors": error_count,
                "total": len(markdown_tasks)
            }
            logger.info(f"Sync completed: {result}")
            return result
            
        except Exception as e:
            logger.error(f"Error in Obsidian sync process: {e}", exc_info=True)
            return {"error": f"Sync failed: {str(e)}"}
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions syncing but doesn't disclose behavioral traits like whether this is a read-only or destructive operation, how conflicts are handled, authentication needs, or rate limits. This is inadequate for a sync tool with potential data mutation implications.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded and wastes no space, making it highly concise and well-structured.

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 0 parameters, 100% schema coverage, and an output schema exists, the description is minimally adequate. However, as a sync operation with no annotations, it lacks details on behavior, error handling, or integration context, which could be important for an AI agent to use 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 tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate, but it implies the sync operation might have implicit inputs (e.g., source files), though not explicitly stated.

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 action ('sync') and resources involved ('tasks from Obsidian markdown into SQLite'), making the purpose understandable. However, it doesn't differentiate this tool from its siblings (like create_task, update_task, list_tasks) in terms of when sync operations are needed versus direct CRUD operations.

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. With siblings like create_task, update_task, and list_tasks, the description doesn't specify scenarios for syncing from Obsidian versus direct database operations, leaving usage unclear.

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/brysontang/DeltaTask'

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