Skip to main content
Glama

memory_usage

Monitor system memory consumption to optimize performance and prevent crashes during music pattern generation and live coding sessions.

Instructions

Get current memory usage statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'memory_usage' tool in the getTools() method, including name, description, and empty input schema (no parameters required).
    { name: 'memory_usage', description: 'Get current memory usage statistics', inputSchema: { type: 'object', properties: {} } },
  • Handler implementation in executeTool switch statement. Calls perfMonitor.getMemoryUsage() and returns the memory stats as JSON or fallback message.
    case 'memory_usage': const memory = this.perfMonitor.getMemoryUsage(); return memory ? JSON.stringify(memory, null, 2) : 'Memory usage not available';
  • Core helper method that retrieves and formats Node.js process.memoryUsage() into human-readable MB values for heapUsed, heapTotal, RSS, and external memory.
    getMemoryUsage() { if (typeof process !== 'undefined' && process.memoryUsage) { const usage = process.memoryUsage(); return { heapUsed: (usage.heapUsed / 1024 / 1024).toFixed(2) + ' MB', heapTotal: (usage.heapTotal / 1024 / 1024).toFixed(2) + ' MB', rss: (usage.rss / 1024 / 1024).toFixed(2) + ' MB', external: (usage.external / 1024 / 1024).toFixed(2) + ' MB' }; } return null; }

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/williamzujkowski/strudel-mcp-server'

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