Skip to main content
Glama

get_user_context

Retrieve stored user facts, patterns, and preferences to personalize responses and support ADHD productivity coaching.

Instructions

Get relevant context about the user (facts, patterns, preferences).

This retrieves stored facts about the user to help personalize responses.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool definition for 'get_user_context' which delegates to the storage layer.
    async def get_user_context() -> str:
        """Get relevant context about the user (facts, patterns, preferences).
    
        This retrieves stored facts about the user to help personalize responses.
        """
        return await storage.get_user_context()
  • The actual implementation of the 'get_user_context' tool logic, which queries the 'user_facts' database table and formats the retrieved data.
    async def get_user_context() -> str:
        """Get relevant context about the user.
    
        Returns:
            Formatted user context
        """
        db = await get_db()
    
        cursor = await db.execute(
            "SELECT fact, category FROM user_facts ORDER BY created_at DESC LIMIT 20"
        )
        rows = await cursor.fetchall()
    
        if not rows:
            return "No user facts stored yet. Use add_user_fact() to remember important information."
    
        result = "\n=== USER CONTEXT ===\n\n"
    
        # Group by category
        categories = {}
        for row in rows:
            cat = row["category"]
            if cat not in categories:
                categories[cat] = []
            categories[cat].append(row["fact"])
    
        for category, facts in categories.items():
            result += f"{category.upper()}:\n"
            for fact in facts:
                result += f"  - {fact}\n"
            result += "\n"
    
        return result.strip()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'retrieves' implies a read-only operation, the description fails to disclose what determines 'relevant' context (filtering logic), the approximate data volume returned, whether it aggregates data from multiple sources, or its relationship to the `add_user_fact` sibling tool.

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?

The description consists of two efficiently structured sentences that are front-loaded with the core action and resource. The second sentence adds value by specifying the data source ('stored facts') and use case ('personalize responses'), though it partially overlaps with the first sentence's content.

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

Completeness3/5

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

Given the presence of an output schema, the description appropriately omits detailed return value specifications. However, given the ecosystem of sibling tools (particularly `add_user_fact`), the description should clarify that this retrieves facts previously stored by that tool. The term 'relevant' also raises unanswered questions about scoping or filtering that could confuse an agent.

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

Parameters4/5

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

The tool has zero parameters with 100% schema description coverage. Per the scoring rubric, this establishes a baseline score of 4. No additional parameter semantics are required or provided in the description, which is appropriate for this simple parameter-less getter.

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

Purpose4/5

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

The description clearly states the tool 'Get[s] relevant context about the user (facts, patterns, preferences)' and clarifies it 'retrieves stored facts.' It effectively distinguishes itself from sibling mutation tools like `add_user_fact` and task-management tools through the specific resource 'user context/facts' and the verb 'Get/retrieves.'

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

Usage Guidelines3/5

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

The description provides implicit guidance by stating the purpose is 'to help personalize responses,' suggesting when to invoke it (before generating personalized output). However, it lacks explicit guidance on when NOT to use it, prerequisites, or how it differs from `get_recommendation` or reading daily notes directly.

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/94aharris/coach-ai'

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