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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/system.ts:45-52 (handler)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); } }, - src/tools/system.ts:41-53 (registration)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); } }, ); - src/tools/system.ts:5-7 (helper)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 }; }