Skip to main content
Glama
dh1789

My First MCP

by dh1789

server_status

Check server uptime and monitor resource usage like memory consumption to maintain system health and performance.

Instructions

MCP 서버 상태를 확인합니다 (uptime, 메모리 사용량 등).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'server_status' that calls getServerStatus(), formats memory bytes, constructs a status text report, logs the call, and returns formatted text content.
    async () => { const status = getServerStatus(); const formatBytes = (bytes: number) => { const mb = bytes / 1024 / 1024; return `${mb.toFixed(2)} MB`; }; const text = ` === MCP 서버 상태 === ⏱️ Uptime: ${status.uptime.toFixed(2)}초 📦 Node.js: ${status.nodeVersion} 💾 메모리 사용량: - Heap Used: ${formatBytes(status.memory.heapUsed)} - Heap Total: ${formatBytes(status.memory.heapTotal)} - RSS: ${formatBytes(status.memory.rss)} `.trim(); log(LogLevel.INFO, "server_status Tool 호출됨"); return { content: [{ type: "text", text }], }; }
  • TypeScript interface defining the ServerStatus object structure returned by getServerStatus().
    export interface ServerStatus { uptime: number; memory: { heapUsed: number; heapTotal: number; rss: number; }; nodeVersion: string; }
  • src/index.ts:578-608 (registration)
    MCP server.tool() registration for 'server_status' tool, with Korean description, empty input schema, and inline handler function.
    server.tool( "server_status", "MCP 서버 상태를 확인합니다 (uptime, 메모리 사용량 등).", {}, async () => { const status = getServerStatus(); const formatBytes = (bytes: number) => { const mb = bytes / 1024 / 1024; return `${mb.toFixed(2)} MB`; }; const text = ` === MCP 서버 상태 === ⏱️ Uptime: ${status.uptime.toFixed(2)}초 📦 Node.js: ${status.nodeVersion} 💾 메모리 사용량: - Heap Used: ${formatBytes(status.memory.heapUsed)} - Heap Total: ${formatBytes(status.memory.heapTotal)} - RSS: ${formatBytes(status.memory.rss)} `.trim(); log(LogLevel.INFO, "server_status Tool 호출됨"); return { content: [{ type: "text", text }], }; } );
  • Helper function that retrieves Node.js process uptime, memory usage, and version, returning a ServerStatus object.
    export function getServerStatus(): ServerStatus { const memoryUsage = process.memoryUsage(); return { uptime: process.uptime(), memory: { heapUsed: memoryUsage.heapUsed, heapTotal: memoryUsage.heapTotal, rss: memoryUsage.rss, }, nodeVersion: process.version, }; }

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/dh1789/my-first-mcp'

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