Skip to main content
Glama

get_memento_statistics

Retrieve database statistics to monitor stored knowledge, track usage patterns, and analyze memory performance for AI assistants.

Instructions

Get statistics about the memento database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function 'handle_get_memento_statistics' implements the tool's logic by retrieving statistics from the memory database and formatting them for the MCP response.
    @handle_tool_errors("get memory statistics")
    async def handle_get_memento_statistics(
        memory_db: SQLiteMemoryDatabase, arguments: Dict[str, Any]
    ) -> CallToolResult:
        """Handle get_memory_statistics tool call.
    
        Args:
            memory_db: Database instance for memory operations
            arguments: Tool arguments from MCP call (no parameters required)
    
        Returns:
            CallToolResult with formatted statistics or error message
        """
        stats = await memory_db.get_memory_statistics()
    
        # Format statistics
        stats_text = "**Memory Database Statistics**\n\n"
    
        if stats.get("total_memories"):
            stats_text += f"Total Memories: {stats['total_memories']['count']}\n"
    
        if stats.get("memories_by_type"):
            stats_text += "\n**Memories by Type:**\n"
            for mem_type, count in stats["memories_by_type"].items():
                stats_text += f"- {mem_type}: {count}\n"
    
        if stats.get("total_relationships"):
            stats_text += (
                f"\nTotal Relationships: {stats['total_relationships']['count']}\n"
            )
    
        if stats.get("avg_importance"):
            stats_text += (
                f"Average Importance: {stats['avg_importance']['avg_importance']:.2f}\n"
            )
    
        if stats.get("avg_confidence"):
            stats_text += (
                f"Average Confidence: {stats['avg_confidence']['avg_confidence']:.2f}\n"
            )
    
        return CallToolResult(content=[TextContent(type="text", text=stats_text)])
Behavior2/5

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

No annotations are provided, so the description must carry full behavioral disclosure burden, yet it reveals nothing about performance characteristics (is this expensive?), return format, caching behavior, or whether this aggregates deleted vs active mementos.

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?

Single sentence with no redundancy, though arguably too brief given the lack of structured metadata (annotations/output schema) and sibling complexity.

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?

Minimal but technically sufficient for a zero-parameter tool; however, with no output schema and vague 'statistics' claim, the description fails to set expectations for what data structure or metrics will be returned.

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?

Input schema has zero parameters, which per scoring rules establishes a baseline of 4. The description correctly implies no filtering is needed, matching the empty schema.

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

Purpose3/5

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

States it retrieves 'statistics about the memento database' but fails to specify what statistics (count, confidence distribution, storage size, temporal metrics?), leaving it ambiguous compared to sibling tools like get_recent_memento_activity or get_low_confidence_mementos which imply specific result sets.

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

Usage Guidelines2/5

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

Provides no guidance on when to use this versus other retrieval tools like get_recent_memento_activity or search_mementos, nor mentions if this is for diagnostics, monitoring, or analytical purposes.

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/x-hannibal/mcp-memento'

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