Skip to main content
Glama
fredriksknese

mcp-openmediavault

get_cpu_temp

Monitor CPU temperature readings on OpenMediaVault NAS systems to track hardware health and prevent overheating issues.

Instructions

Get CPU temperature readings from OpenMediaVault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'get_cpu_temp' tool that executes an RPC call to 'CpuTemp.getStats' and returns the CPU temperature readings as JSON. Handles errors and returns appropriate error messages.
    async () => {
      try {
        const result = await client.rpc("CpuTemp", "getStats", {});
        return toolResult(JSON.stringify(result, null, 2));
      } catch (error) {
        return toolResult(`Error fetching CPU temperature: ${error}`, true);
      }
    },
  • Tool registration for 'get_cpu_temp' using server.tool() method. Defines the tool name, description, empty input schema (no parameters), and the handler function.
    server.tool(
      "get_cpu_temp",
      "Get CPU temperature readings from OpenMediaVault",
      {},
      async () => {
        try {
          const result = await client.rpc("CpuTemp", "getStats", {});
          return toolResult(JSON.stringify(result, null, 2));
        } catch (error) {
          return toolResult(`Error fetching CPU temperature: ${error}`, true);
        }
      },
    );
  • Helper function that formats tool results into the expected MCP response format with content array and optional error flag.
    function toolResult(text: string, isError = false) {
      return { content: [{ type: "text" as const, text }], isError };
    }

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/fredriksknese/mcp-openmediavault'

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