Skip to main content
Glama
dknell

System Information MCP Server

by dknell

get_temperature_info_tool

Retrieve system temperature sensor data to monitor hardware thermal status and prevent overheating issues.

Instructions

Retrieve system temperature sensors (when available).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function for 'get_temperature_info_tool', decorated with @app.tool() which registers it, delegating execution to the core get_temperature_info() helper.
    @app.tool() def get_temperature_info_tool() -> Dict[str, Any]: """Retrieve system temperature sensors (when available).""" return get_temperature_info()
  • The core helper function implementing the temperature and fan sensor data retrieval using psutil.sensors_temperatures() and psutil.sensors_fans(), with caching.
    @cache_result("temperature_info", ttl=10) def get_temperature_info() -> Dict[str, Any]: """Retrieve system temperature sensors (when available).""" if not config.enable_temperatures: return {"temperatures": [], "fans": []} try: temperatures = [] fans = [] # Try to get temperature sensors try: if hasattr(psutil, 'sensors_temperatures'): sensors_temps = psutil.sensors_temperatures() if sensors_temps: for sensor_name, temps in sensors_temps.items(): for temp in temps: temp_info = { "name": temp.label or sensor_name, "current": round(temp.current, 1), "unit": "celsius", } if temp.high: temp_info["high"] = round(temp.high, 1) if temp.critical: temp_info["critical"] = round(temp.critical, 1) temperatures.append(temp_info) except (AttributeError, OSError) as e: logger.debug(f"Temperature sensors not available: {e}") # Try to get fan sensors try: if hasattr(psutil, 'sensors_fans'): sensors_fans = psutil.sensors_fans() if sensors_fans: for fan_name, fan_list in sensors_fans.items(): for fan in fan_list: fan_info = { "name": fan.label or fan_name, "current_speed": safe_int(fan.current), "unit": "rpm", } fans.append(fan_info) except (AttributeError, OSError) as e: logger.debug(f"Fan sensors not available: {e}") return {"temperatures": temperatures, "fans": fans} except Exception as e: logger.error(f"Error getting temperature info: {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