getMemoryInfo
Retrieve current system memory usage details including available, used, and total memory to monitor resource allocation and performance.
Instructions
获取当前系统的内存信息
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "getMemoryInfo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:303-316 (handler)Handler implementation for the getMemoryInfo tool. It calculates total memory, free memory, and used memory using Node.js 'os' module functions and returns the information as a JSON-formatted text 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 (registration)Registration of the getMemoryInfo tool in the list of tools provided by the handleRequest function, including its name, description, and input schema (which is an empty object).
{ name: "getMemoryInfo", description: "获取当前系统的内存信息", inputSchema: { type: "object", properties: {}, required: [] } }, - src/index.ts:40-44 (schema)Input schema definition for the getMemoryInfo tool, specifying an empty object with no properties or requirements.
inputSchema: { type: "object", properties: {}, required: [] }