Skip to main content
Glama
dknell

System Information MCP Server

by dknell

get_system_uptime_tool

Retrieve system uptime and boot information to monitor server availability and track system restart history.

Instructions

Retrieve system uptime and boot information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'get_system_uptime_tool' tool, registered via @app.tool() decorator. It delegates the core logic 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()
  • Core helper function implementing the system uptime logic using psutil.boot_time(). Computes uptime in seconds, formats it, and returns boot time in ISO format.
    @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

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