from __future__ import annotations

import json
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mcp.server.fastmcp import FastMCP

    from niannian.mcp.service import NianNianService


def register_system_tools(mcp: FastMCP, svc: NianNianService) -> None:
    @mcp.tool()
    def niannian_health() -> str:
        """检查念念数据目录与状态。"""
        return json.dumps(svc.health(), ensure_ascii=False)

    @mcp.tool()
    def niannian_sync_status() -> str:
        """查看云端同步状态。"""
        return json.dumps(svc.sync_status(), ensure_ascii=False)
