Skip to main content
Glama
dknell

System Information MCP Server

by dknell

get_system_uptime_tool

Retrieve system uptime and boot information from the System Information MCP Server to monitor server performance and diagnose issues.

Instructions

Retrieve system uptime and boot information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_system_uptime_tool', decorated with @app.tool() for registration. Delegates to the get_system_uptime helper function.
    @app.tool() def get_system_uptime_tool() -> Dict[str, Any]: """Retrieve system uptime and boot information.""" return get_system_uptime()
  • The core helper function implementing the system uptime logic using psutil.boot_time(), computing uptime in seconds, formatting it, and converting boot time to ISO.
    @cache_result("system_uptime", ttl=30) def get_system_uptime() -> Dict[str, Any]: """Retrieve system uptime and boot information.""" try: boot_time = psutil.boot_time() current_time = time.time() uptime_seconds = int(current_time - boot_time) return { "boot_time": timestamp_to_iso(boot_time), "uptime_seconds": uptime_seconds, "uptime_formatted": format_uptime(uptime_seconds), } except Exception as e: logger.error(f"Error getting system uptime: {e}") raise

Other Tools

Related Tools

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/dknell/mcp-system-info'

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