Skip to main content
Glama

chronica_compose_opening

Initialize conversations by retrieving current timestamp, elapsed time since last interaction, and recent memory context for project continuity.

Instructions

【最優先ルール】

  • 会話の冒頭で「状況確認」「記憶を確認」「現状を教えて」等の 要求があった場合、他のツールより先に本ツールを呼ぶこと。

  • 必ず project 引数に現在のプロジェクト名を渡してから呼ぶこと。

  • project 引数なしで他のツールを先に呼ぶことは禁止。

会話開始時に必ず呼び出すこと。 現在時刻(年月日・時分秒)、前回の会話からの経過時間、記憶コンテキストを取得します。

【現在時刻について(重要)】

  • 返却テキストの [現在状況] に「現在時刻: YYYY-MM-DD HH:MM:SS」が含まれる。これはPCローカル時計に基づく正確な値。

  • ユーザーが「今何時」「正確な時刻」「リアルタイムで時刻を」等と尋ねたときも、本ツールを呼び出してその行の時刻を答えること。

  • 本ツールを呼ばずに「時分は取得できない」と答えてはならない。時刻が必要なら必ず呼ぶ。

【Claude向けの指示】

  • 返された情報が絶対的な事実

  • 自分で時間を推測しない

  • 季節への過度な言及は避ける

  • 「Chronicaによると」等のメタ発言は避ける

  • 自然に「お久しぶりです」「前回は〜について話していましたね」等と声をかける

【プロジェクト引き継ぎ時の注意】

  • 新しい会話で「前回の作業を確認して」と言われたら、 compose_opening の後に必ず chronica_search を project 指定で呼び出してプロジェクト記憶を取得すること。

  • compose_opening だけでは通常会話の直近トピックのみ返る。 プロジェクトの詳細な作業ログは search で取得する。

【ユーザーへの推奨呼び出し方(vol引き継ぎ等)】 「chronica_searchをproject『プロジェクト名』・タグ『volN』で呼んで、 前回の作業内容を確認して」

【重要】呼び出す際は必ず project 引数に現在の会話のプロジェクト名を渡すこと。

例: project="Chronica"、project="Lumina v3" プロジェクト名が不明な場合は chronica_list_threads で確認してから呼ぶこと。 project を渡さないと別プロジェクトの記憶が混入するため、必ず指定すること。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idNoスレッドID(指定時はそのスレッドの最後の対話を取得)
projectNo現在の会話のプロジェクト名。必ず指定すること。

Implementation Reference

  • Tool handler for 'chronica_compose_opening' which invokes 'compose_opening_context'.
    elif name == "chronica_compose_opening":
        # スレッドIDが指定されている場合はそれを渡す
        thread_id = arguments.get("thread_id") if arguments else None
        project = arguments.get("project") if arguments else None
        context = compose_opening_context(store, thread_id, project)
        return [types.TextContent(
            type="text",
            text=context
        )]
  • Core logic for 'chronica_compose_opening' tool: constructs the contextual prompt for Claude including current time, season, and recent project entries.
    def compose_opening_context(store: Store, thread_id: str = None, project: str = None) -> str:
        """
        会話開始時のコンテキストを生成
    
        Claude向けに最適化:
        - 定型句を削減
        - メタ発言を避ける指示
        - 自然な日本語への誘導
        """
        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 = "秋"
    
        recent_entries = store.search(thread_type="project", project=project, limit=5)
        flow_block = _format_flow_section(recent_entries, now)
        unresolved_block = _format_unresolved_section(recent_entries, now)
    
        # Claudeへの指示(簡潔に、自然な対話を促す)
        context = f"""=== Chronica Context ===
    [現在状況]
    - 現在時刻: {current_time}
    - 時間帯: {season}の{time_of_day}
    
    {flow_block}
    
    {unresolved_block}
    
    [Claude への指示]
    1. 「プロジェクトの直近の流れ」を把握した上で自然に声をかける
    2. 時間差に応じた挨拶(「お久しぶりです」「こんにちは」等)
    3. 直近の流れの中で最も会話に繋げやすいトピックに自然に触れる
    4. 「Chronicaによると」等のメタ発言は避ける
    5. 記憶を探すときは thread_id を指定せず thread_type=\"project\" で横断検索する
    6. 「エントリーがありません」となった場合は thread_id なしで再検索する
    7. ユーザーから新しい情報が得られたら chronica_save_entry で保存
    8. 保存時に「保存しました」等の確認は不要
    
    【良い例】
  • Definition/Registration of the 'chronica_compose_opening' tool in the tool set.
    ),
    types.Tool(
Behavior4/5

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

Without annotations, the description carries the burden and discloses return format ([現在状況] with '現在時刻: YYYY-MM-DD HH:MM:SS'), data source (PC local clock), and behavioral constraints for the AI (do not guess time, avoid meta-references). Slight deduction because it does not clarify whether the tool writes session state (implied by 'session' siblings) or is purely read-only.

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?

Lengthy but well-structured with clear section headers (【最優先ルール】, 【現在時刻について】, etc.) and front-loaded critical constraints. Every section serves a distinct purpose (invocation order, time handling accuracy, AI behavior guidelines, project handoff workflows). Minor verbosity in the Claude-specific behavioral instructions is justified by the orchestration 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?

Comprehensive coverage compensating for missing output schema by detailing exact return text format, timestamp syntax, and content sections. Covers error prevention (finding project names) and integration patterns with the full sibling toolset (especially the `compose_opening` → `search` workflow). Complete for a session-orchestration tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage (baseline 3), the description adds critical semantic context: warns that omitting `project` causes cross-project memory contamination (「別プロジェクトの記憶が混入」), mandates its use (「必ず指定」), provides examples ('Chronica', 'Lumina v3'), and specifies the fallback workflow (use `chronica_list_threads` if unknown). This significantly exceeds the schema's basic descriptions.

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 retrieves current time, elapsed time since last conversation, and memory context at conversation start (「現在時刻...記憶コンテキストを取得します」). It clearly distinguishes from sibling `chronica_search` by stating this tool only returns recent topics while search retrieves detailed project logs.

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 rules: must be called first when users ask for status/memory at conversation start (「他のツールより先に本ツールを呼ぶこと」), and explicitly forbids calling other tools first without the project parameter. Clearly differentiates workflow: use `compose_opening` first, then `chronica_search` for detailed handoffs.

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