generate_session_summary
Creates a markdown summary of journaling sessions to document conversations and maintain continuity in daily activity discussions.
Instructions
Generate a markdown summary of the journaling session.
Args: summary: The llm generated summay of the conversation
Returns: str: Confirmation message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes |
Implementation Reference
- server.py:168-201 (handler)The handler function decorated with @mcp.tool(), which registers and implements the generate_session_summary tool. It formats the conversation log into a markdown journal entry with a header, transcript, and provided summary, then saves it using save_journal_entry.@mcp.tool() async def generate_session_summary(summary: str) -> str: """ Generate a markdown summary of the journaling session. Args: summary: The llm generated summay of the conversation Returns: str: Confirmation message """ if not conversation_log: return "No conversation to summarize. Please start a new session first." lines = [] # Add header with date today = datetime.now().strftime("%B %d, %Y") lines.append(f"# Journal Entry - {today}\n") # Add conversation transcript lines.append("## Conversation\n") for entry in conversation_log: speaker = "You" if entry["speaker"] == "user" else "Assistant" timestamp = datetime.fromisoformat(entry["timestamp"]).strftime("%H:%M") lines.append(f"**{speaker} ({timestamp})**: {entry['message']}\n") # Add reflection prompt for emotional analysis lines.append("\n## Emotional Analysis\n") lines.append(summary) file_text = "\n".join(lines) await save_journal_entry(file_text) return "Conversation saved to journal"