get_memory_stats
Retrieve memory usage statistics from MCP Contemplation to monitor and analyze cognitive processing resources during continuous background operations.
Instructions
Get memory usage statistics
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:286-301 (handler)The core handler function in ContemplationManager that computes and returns memory statistics including total insights, unused insights, high significance count, aggregated patterns, memory limit, threshold, and estimated context usage.getMemoryStats(): any { const total = this.insights.length; const unused = this.insights.filter(i => !i.used).length; const highSig = this.insights.filter(i => i.significance >= 8).length; const aggregated = this.insights.filter(i => i.similar_count && i.similar_count > 1).length; return { total_insights: total, unused_insights: unused, high_significance: highSig, aggregated_patterns: aggregated, memory_limit: this.maxInsightsInMemory, significance_threshold: this.significanceThreshold, estimated_context_usage: `${Math.round((total / this.maxInsightsInMemory) * 100)}%` }; }
- src/index.ts:450-456 (registration)Tool registration in the ListToolsRequestHandler, defining the name, description, and empty input schema.name: 'get_memory_stats', description: 'Get memory usage statistics', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:543-548 (handler)The tool dispatcher case in CallToolRequestHandler that invokes the getMemoryStats method and formats the response as MCP content.case 'get_memory_stats': { const stats = contemplation.getMemoryStats(); return { content: [{ type: 'text', text: JSON.stringify(stats, null, 2) }], }; }
- src/index.ts:452-456 (schema)Input schema definition for the get_memory_stats tool (empty object, no parameters required).inputSchema: { type: 'object', properties: {}, }, },