Skip to main content
Glama

chronica_session_tick

Synchronize time-aware context before each Claude response by fetching current timestamp, elapsed time since last interaction, and recent conversation preview from persistent memory.

Instructions

【毎ターン・返答前に呼ぶ】MCPはサーバーからClaudeへ能動プッシュできないため、 ユーザーからメッセージを受け取ったら、返答を書く直前に必ず本ツールを呼ぶこと。 「常に許可」推奨。負荷は極小(短いJSONのみ)。

返却JSONの意味:

  • now_local: 現在のローカル日時(時分秒まで正確)

  • since_last_memory: 最後の記憶からの経過(「3日前」「数分前」「初回」など)→「何日ぶり」の根拠

  • last_topic_preview: 直近記憶の冒頭

  • season / time_of_day: 季節・時間帯

chronica_compose_opening は会話開始の挨拶用。2通目以降は本ツールで時刻・経過を毎回同期する。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idNoスレッドID(省略時は全体の直近記憶から経過を算出)

Implementation Reference

  • The logic that generates the response payload for the chronica_session_tick tool.
    def session_tick_payload(store: Store, thread_id: Optional[str] = None) -> Dict[str, Any]:
        """
        各会話ターン用の軽量コンテキスト(JSON)。
        MCP はホストに能動プッシュできないため、モデルが毎ターン呼ぶ前提で提供する。
        """
        now = datetime.now().astimezone()
        current_time = now.strftime("%Y-%m-%d %H:%M:%S")
        hour = now.hour
        if 5 <= hour < 11:
            time_of_day = "朝"
        elif 11 <= hour < 17:
            time_of_day = "昼"
        elif 17 <= hour < 21:
            time_of_day = "夕方"
        else:
            time_of_day = "夜"
        month = now.month
        if month in [12, 1, 2]:
            season = "冬"
        elif month in [3, 4, 5]:
            season = "春"
        elif month in [6, 7, 8]:
            season = "夏"
        else:
            season = "秋"
    
        time_expr, last_topic, _ = _memory_recency(store, thread_id, now)
    
        return {
            "now_local": current_time,
            "season": season,
            "time_of_day": time_of_day,
            "since_last_memory": time_expr,
            "last_topic_preview": last_topic,
        }
  • The tool handler implementation that calls session_tick_payload when chronica_session_tick is invoked.
    elif name == "chronica_session_tick":
        thread_id = arguments.get("thread_id") if arguments else None
        payload = session_tick_payload(store, thread_id)
        return [types.TextContent(
            type="text",
            text=json.dumps(payload, ensure_ascii=False)
        )]
  • The MCP tool registration and schema definition for chronica_session_tick.
                    name="chronica_session_tick",
                    description="""
    【毎ターン・返答前に呼ぶ】MCPはサーバーからClaudeへ能動プッシュできないため、
    ユーザーからメッセージを受け取ったら、返答を書く直前に必ず本ツールを呼ぶこと。
    「常に許可」推奨。負荷は極小(短いJSONのみ)。
    
    返却JSONの意味:
    - now_local: 現在のローカル日時(時分秒まで正確)
    - since_last_memory: 最後の記憶からの経過(「3日前」「数分前」「初回」など)→「何日ぶり」の根拠
    - last_topic_preview: 直近記憶の冒頭
    - season / time_of_day: 季節・時間帯
    
    chronica_compose_opening は会話開始の挨拶用。2通目以降は本ツールで時刻・経過を毎回同期する。
    """,
Behavior4/5

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

With no annotations, the description carries full burden and discloses: lightweight nature ('負荷は極小'), safety recommendation ('常に許可'推奨), and detailed return JSON structure (now_local, since_last_memory, etc.). Could explicitly state 'read-only' or 'idempotent' for perfection, but safety is strongly implied.

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?

Well-structured with clear visual hierarchy: header instruction, load characteristics, return value documentation, and sibling differentiation. Every sentence serves a purpose (architectural rationale, timing, return values, alternatives). Slightly dense but appropriately sized for the complexity.

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

Completeness5/5

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

Despite lacking a formal output schema, the description comprehensively documents all return fields (now_local, since_last_memory, last_topic_preview, season, time_of_day) and their semantics. Given single optional parameter and clear sibling relationships, the description is complete.

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 has 100% coverage with thread_id already described as optional ('省略時は全体の直近記憶から経過を算出'). The description mentions thread_id behavior in the context of return values but does not add semantic meaning beyond the schema description, warranting baseline score 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description explicitly states the tool synchronizes time/elapsed time every turn before responding, using specific verbs like '呼ぶ' (call) and '同期する' (sync). It clearly distinguishes from sibling 'chronica_compose_opening' by specifying this is for 2nd message onward versus opening greetings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use ('毎ターン・返答前に呼ぶ', '2通目以降は本ツール') and when-not-to-use guidance (use 'chronica_compose_opening' for conversation opening). Also notes the architectural constraint requiring this polling pattern due to MCP's inability to push from server to Claude.

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/Nic9dev/Chronica'

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