Skip to main content
Glama

sync_planning_doc

Update project planning documents by appending progress logs, updating active work status, or marking tasks as complete to maintain current development tracking.

Instructions

Update .context/dev/{branch}/ planning documents. Can append to progress log, update active work, or mark tasks complete.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYesUpdate mode: append_progress_log, update_active_work, or mark_tasks_complete
completed_tasksNoList of completed task descriptions (for append_progress_log or mark_tasks_complete)
in_progressNoCurrent work in progress (for update_active_work)
decisionsNoKey decisions made (for append_progress_log)
blockersNoCurrent blockers or issues (for update_active_work)
next_stepsNoNext immediate steps (for update_active_work)
working_directoryNoWorking directory for git operations. Defaults to current directory.

Implementation Reference

  • The _sync_planning_doc function handles the logic for syncing planning documents, including parsing arguments, locating the plan file, and delegating the update to helper functions based on the mode.
    async def _sync_planning_doc(arguments: dict[str, Any]) -> dict:
        """Update .context planning documents."""
        mode = arguments.get("mode")
        working_dir = arguments.get("working_directory") or _get_working_directory()
    
        if not mode:
            return {"success": False, "error": "mode is required"}
    
        git = GitUtils(working_dir)
        plan_path = git.get_context_plan_path()
    
        if not plan_path:
            # Try to construct path even if file doesn't exist
            branch = git.get_current_branch()
            root = git.get_project_root()
            if branch and root:
                plan_path = root / ".context" / "dev" / branch / f"{branch}-detailed-plan.md"
            else:
                return {
                    "success": False,
                    "error": "Could not determine plan path. Not a git repo or no branch.",
                }
    
        if not plan_path.exists():
            return {
                "success": False,
                "error": f"Plan file not found: {plan_path}",
                "plan_path": str(plan_path),
            }
    
        # Read existing content
        content = plan_path.read_text(encoding="utf-8")
        sections_updated = []
    
        if mode == "append_progress_log":
            content, updated = _append_progress_log(
                content,
                completed_tasks=arguments.get("completed_tasks", []),
                decisions=arguments.get("decisions", []),
                blockers=arguments.get("blockers", []),
            )
            if updated:
                sections_updated.append("Progress Log")
    
        elif mode == "update_active_work":
            content, updated = _update_active_work(
                content,
                in_progress=arguments.get("in_progress"),
                next_steps=arguments.get("next_steps", []),
                blockers=arguments.get("blockers", []),
            )
            if updated:
                sections_updated.append("Active Work")
    
        elif mode == "mark_tasks_complete":
            completed_tasks = arguments.get("completed_tasks", [])
            for task in completed_tasks:
                content = content.replace(f"- [ ] {task}", f"- [x] {task}")
            if completed_tasks:
                sections_updated.append("Implementation Plan")
    
        else:
            return {"success": False, "error": f"Unknown mode: {mode}"}
    
        # Write updated content
        plan_path.write_text(content, encoding="utf-8")
    
        return {
            "success": True,
            "plan_path": str(plan_path),
            "sections_updated": sections_updated,
        }
  • Tool registration for 'sync_planning_doc' in the MCP server's list_tools definition.
        name="sync_planning_doc",
        description="Update .context/dev/{branch}/ planning documents. Can append to progress log, update active work, or mark tasks complete.",
        inputSchema={
            "type": "object",
            "properties": {
                "mode": {
                    "type": "string",
                    "enum": ["append_progress_log", "update_active_work", "mark_tasks_complete"],
                    "description": "Update mode: append_progress_log, update_active_work, or mark_tasks_complete",
                },
                "completed_tasks": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "List of completed task descriptions (for append_progress_log or mark_tasks_complete)",
                },
                "in_progress": {
                    "type": "string",
                    "description": "Current work in progress (for update_active_work)",
                },
                "decisions": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Key decisions made (for append_progress_log)",
                },
                "blockers": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Current blockers or issues (for update_active_work)",
                },
                "next_steps": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Next immediate steps (for update_active_work)",
                },
                "working_directory": {
                    "type": "string",
                    "description": "Working directory for git operations. Defaults to current directory.",
                },
            },
            "required": ["mode"],
        },
    ),
  • Helper function _append_progress_log for updating the progress log section of the plan file.
    def _append_progress_log(
        content: str,
        completed_tasks: list[str],
        decisions: list[str],
        blockers: list[str],
    ) -> tuple[str, bool]:
        """Append entry to Progress Log section."""
        timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
    
        entry_lines = [f"\n### {timestamp} - Session Update"]
        if completed_tasks:
            entry_lines.append("- **Completed:**")
            for task in completed_tasks:
                entry_lines.append(f"  - {task}")
        if decisions:
            entry_lines.append("- **Decisions:**")
            for decision in decisions:
                entry_lines.append(f"  - {decision}")
        if blockers:
            entry_lines.append("- **Blockers:**")
            for blocker in blockers:
                entry_lines.append(f"  - {blocker}")
    
        entry = "\n".join(entry_lines) + "\n"
    
        # Find Progress Log section and insert after header
        marker = "## Progress Log"
        if marker in content:
            idx = content.find(marker)
            # Find end of line
            end_of_line = content.find("\n", idx)
            if end_of_line != -1:
                content = content[:end_of_line + 1] + entry + content[end_of_line + 1:]
                return content, True
    
        return content, False
  • Helper function _update_active_work for updating the active work section of the plan file.
    def _update_active_work(
        content: str,
        in_progress: str | None,
        next_steps: list[str],
        blockers: list[str],
    ) -> tuple[str, bool]:
        """Update Active Work section."""
        timestamp = datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ")
    
        new_section_lines = [
            "## Active Work (Current Session)",
            f"**Last updated:** {timestamp}",
            "",
            "### In Progress:",
        ]
        if in_progress:
            new_section_lines.append(f"- {in_progress}")
        else:
            new_section_lines.append("- (none)")
    
        new_section_lines.extend(["", "### Next Immediate Steps:"])
        if next_steps:
            for step in next_steps:
                new_section_lines.append(f"- {step}")
        else:
            new_section_lines.append("- (none)")
    
        if blockers:
            new_section_lines.extend(["", "### Blockers/Notes:"])
            for blocker in blockers:
                new_section_lines.append(f"- {blocker}")
    
        new_section = "\n".join(new_section_lines) + "\n"
    
        # Find and replace Active Work section
        start_marker = "## Active Work"
        if start_marker in content:
            start_idx = content.find(start_marker)
            # Find next ## section
            next_section = content.find("\n## ", start_idx + 1)
            if next_section != -1:
                content = content[:start_idx] + new_section + "\n" + content[next_section + 1:]
            else:
                # Active Work is last section
                content = content[:start_idx] + new_section
            return content, True
    
        return content, False
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 indicates this is a mutation tool ('Update'), but doesn't disclose permissions needed, whether changes are reversible, rate limits, or what happens to the planning documents. The description mentions what can be done but not the behavioral implications.

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 concise with two sentences that efficiently convey the tool's purpose and capabilities. It's front-loaded with the main action and resource, followed by specific operations. No wasted words or redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 7 parameters and no annotations or output schema, the description is insufficient. It doesn't explain the expected outcome format, error conditions, or how the different modes affect the planning documents. The agent would need to guess about the tool's behavior and results.

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?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema descriptions, so it meets the baseline for high schema coverage.

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 ('Update') and target resource ('.context/dev/{branch}/ planning documents'), and specifies three specific operations (append to progress log, update active work, mark tasks complete). However, it doesn't differentiate this tool from sibling tools, which appear unrelated to planning document management.

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, prerequisites, or contextual triggers. It lists three modes but doesn't explain when each mode is appropriate or how they relate to different planning scenarios.

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/TimEvans/ccsession'

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