add_user_fact
Store user preferences, challenges, strengths, and patterns to personalize Coach AI's recommendations and support.
Instructions
Remember an important fact about the user.
Use this to remember preferences, patterns, challenges, strengths, routines, etc. These facts help personalize recommendations and support.
Args: fact: The fact to remember (e.g., "Works best in mornings", "Struggles with context switching") category: Category - 'preferences', 'challenges', 'strengths', 'patterns', 'routines', or 'general'
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fact | Yes | ||
| category | No | general |
Implementation Reference
- src/coach_ai/storage.py:336-353 (handler)The actual implementation of the tool, which interacts with the database to store the user fact.
async def add_user_fact(fact: str, category: str = "general") -> str: """Remember an important fact about the user. Args: fact: The fact to remember category: Category of the fact Returns: Success message """ db = await get_db() await db.execute( "INSERT INTO user_facts (fact, category) VALUES (?, ?)", (fact, category) ) await db.commit() return f"✓ Remembered: {fact} (category: {category})" - src/coach_ai/server.py:579-590 (registration)The registration of the tool as an MCP tool, which calls the storage implementation.
@mcp.tool() async def add_user_fact(fact: str, category: str = "general") -> str: """Remember an important fact about the user. Use this to remember preferences, patterns, challenges, strengths, routines, etc. These facts help personalize recommendations and support. Args: fact: The fact to remember (e.g., "Works best in mornings", "Struggles with context switching") category: Category - 'preferences', 'challenges', 'strengths', 'patterns', 'routines', or 'general' """ return await storage.add_user_fact(fact, category)