getMemoryInfo
Retrieve detailed memory usage and allocation data from the current operating environment for system monitoring and performance analysis.
Instructions
获取当前系统的内存信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:303-316 (handler)Handler for getMemoryInfo tool: retrieves total memory, free memory, and calculates used memory using Node's os module, then returns JSON stringified response.case "getMemoryInfo": { const memoryInfo = { totalMemory: os.totalmem(), freeMemory: os.freemem(), usedMemory: os.totalmem() - os.freemem() }; return { content: [{ type: "text", text: JSON.stringify(memoryInfo, null, 2) }] }; }
- src/index.ts:37-45 (schema)Schema definition for getMemoryInfo tool in the ListTools response, including name, description, and empty input schema (no parameters required).{ name: "getMemoryInfo", description: "获取当前系统的内存信息", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:790-790 (registration)General registration of the CallToolRequest handler which includes the switch case for getMemoryInfo.server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);