{"record":{"id":"af6603d3c3df34a8","repo":"nicolargo/glances","slug":"plugin-plugin-not-found","errorCode":null,"errorMessage":"Plugin '{plugin}' not found","messagePattern":"Plugin '(.+?)' not found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"glances/outputs/glances_mcp.py","lineNumber":253,"sourceCode":"                raise ValueError(f\"Plugin '{plugin}' not found. Available plugins: {available}\")\n            return server._serialize(plugin_obj.get_raw())\n\n        # ---- per-plugin history (resource template) ----------------------\n\n        @mcp.resource(\n            \"glances://stats/{plugin}/history\",\n            name=\"plugin_history\",\n            description=(\n                \"Historical time-series data for a specific monitoring plugin. \"\n                \"Returns a dict of field→list pairs, most-recent value last.\"\n            ),\n            mime_type=\"application/json\",\n        )\n        def plugin_history(plugin: str) -> str:\n            stats = server._get_stats()\n            plugin_obj = stats.get_plugin(plugin)\n            if plugin_obj is None:\n                raise ValueError(f\"Plugin '{plugin}' not found\")\n            # nb=0 → return all available history points\n            return server._serialize(plugin_obj.get_raw_history(item=None, nb=0))\n\n        # ---- all limits --------------------------------------------------\n\n        @mcp.resource(\n            \"glances://limits\",\n            name=\"all_limits\",\n            description=(\n                \"Warning and critical alert thresholds for all monitoring plugins. \"\n                \"Returns a JSON object keyed by plugin name.\"\n            ),\n            mime_type=\"application/json\",\n        )\n        def all_limits() -> str:\n            return server._serialize(server._get_stats().getAllLimitsAsDict())\n\n        # ---- per-plugin limits (resource template) -----------------------","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_mcp.py#L235-L271","documentation":"The glances://stats/{plugin}/history resource returns raw history points (nb=0 → all) and raises a plain ValueError when the plugin name doesn't resolve. Same lookup pattern as plugin_stats but a shorter message without the available-plugins hint.","triggerScenarios":"Requesting glances://stats/{plugin}/history for a misspelled or unloaded plugin; asking history of a plugin that exists but hasn't collected yet can return sparse data, whereas a wrong name raises immediately.","commonSituations":"MCP clients probing history for plugins like 'net' on hosts where it's disabled; case mismatch ('MEM' vs 'mem').","solutions":["Use exact plugin names — list them first via glances://plugins or the plugins_list tool.","Check that the plugin is enabled (not in disable_plugin) and supported on this OS.","Prefer the plugin_stats resource message (index 8) which includes available names, for discovery."],"exampleFix":"# before\nread glances://stats/network/history\n\n# after\nread glances://stats/net/history","handlingStrategy":"validation","validationCode":"if stats.get_plugin(plugin) is None:\n    raise KeyError(f'{plugin} not loaded; valid: {stats.getPluginsList()}')","typeGuard":"def history_available(stats, name: str) -> bool:\n    return stats.get_plugin(name) is not None","tryCatchPattern":"try:\n    h = read(f'glances://stats/{plugin}/history')\nexcept ValueError:\n    plugin = next(p for p in stats.getPluginsList() if p.lower() == plugin.lower())","preventionTips":["Use the stats resource error message (index 8) to enumerate valid names.","Give newly started instances a few refresh cycles before requesting history."],"tags":["mcp","plugin-not-found","history"],"backgroundTag":"resource-not-found","analyzedSha":"a240d8dfb3105a38b5964357ec21768594b0e83e","analyzedAt":"2026-08-27T19:15:19.178Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}