get_memory_stats
Retrieve memory usage statistics to monitor and analyze system performance within the MCP Contemplation server's cognitive processing environment.
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 insights, aggregated patterns, memory limit, significance 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:449-456 (registration)Registers the 'get_memory_stats' tool in the ListTools response, defining its 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 switch case in the CallToolRequestHandler that invokes the getMemoryStats handler 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) }], }; }