Skip to main content
Glama

get_usage_stats

Retrieve user usage statistics and plan details on the Memory Box MCP Server, enabling efficient memory storage and semantic search insights.

Instructions

Retrieve user usage statistics and plan information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the get_usage_stats tool by fetching stats via MemoryBoxClient.getUserStats() and formatting them into a readable text response including plan info, usage, limits, and breakdown.
    case "get_usage_stats": {
      // Get usage statistics
      const result = await memoryBoxClient.getUserStats();
    
      // Format the results in a user-friendly way
      let responseText = "Usage Statistics:\n\n";
      
      // Add plan information
      responseText += `Current Plan: ${result.plan}\n`;
      if (result.is_legacy_user) {
        responseText += "Status: Legacy User (No Enforced Limits)\n\n";
      } else {
        responseText += "Status: Standard User\n\n";
      }
      
      // Add current month usage
      responseText += "Current Month Usage:\n";
      responseText += `- Store Memory Operations: ${result.current_month_usage.store_memory_count}\n`;
      responseText += `- Search Memory Operations: ${result.current_month_usage.search_memory_count}\n`;
      responseText += `- API Calls: ${result.current_month_usage.api_call_count}\n`;
      responseText += `- Total Data Processed: ${formatBytes(result.current_month_usage.total_bytes_processed)}\n\n`;
      
      // Add limits if not a legacy user
      if (!result.is_legacy_user && result.limits) {
        responseText += "Plan Limits:\n";
        responseText += `- Store Memory Limit: ${result.limits.store_memory_limit} operations\n`;
        responseText += `- Search Memory Limit: ${result.limits.search_memory_limit} operations\n`;
        responseText += `- API Call Limit: ${result.limits.api_call_limit} operations\n`;
        responseText += `- Storage Limit: ${formatBytes(result.limits.storage_limit_bytes)}\n\n`;
      }
      
      // Add operation breakdown if available
      if (result.operations_breakdown && result.operations_breakdown.length > 0) {
        responseText += "Operation Breakdown:\n";
        result.operations_breakdown.forEach((op: any) => {
          responseText += `- ${op.operation}: ${op.count} operations\n`;
        });
      }
    
      return {
        content: [{
          type: "text",
          text: responseText
        }]
      };
    }
  • src/index.ts:764-773 (registration)
    Registers the get_usage_stats tool in the listTools response, providing name, description, and empty input schema.
    {
      name: "get_usage_stats",
      description: "Retrieve user usage statistics and plan information",
      inputSchema: {
        type: "object",
        properties: {
          // No specific parameters needed for this operation
        }
      }
    },
  • MemoryBoxClient method that performs the actual API request to retrieve user usage statistics from /api/v2/usage.
    async getUserStats(): Promise<any> {
      try {
        const response = await axios.get(
          `${this.baseUrl}/api/v2/usage`,
          {
            headers: {
              "Authorization": `Bearer ${this.token}`
            }
          }
        );
        return response.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to retrieve usage statistics: ${error.response?.data?.detail || error.message}`
          );
        }
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'retrieve,' implying a read-only operation, but doesn't specify permissions, rate limits, data freshness, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or unnecessary elaboration. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a retrieval tool. It doesn't explain what 'usage statistics and plan information' entails, how the data is returned, or any behavioral aspects like error handling. For a tool in a server with multiple siblings, more context is needed to ensure proper usage.

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 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The baseline for such cases is 4, as the description doesn't need to compensate for any parameter gaps, and it correctly avoids redundant information.

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 verb ('retrieve') and resource ('user usage statistics and plan information'), making the purpose understandable. However, it doesn't differentiate this tool from its siblings (like check_memory_status or get_buckets), which are also retrieval operations but for different resources, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like get_buckets or get_all_memories that also retrieve data, there's no indication of context, prerequisites, or exclusions, leaving the agent to guess based on the tool name alone.

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

Related 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/amotivv/memory-box-mcp'

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