{"record":{"id":"ab96d9788b21a6cc","repo":"nicolargo/glances","slug":"plugin-plugin-not-found-available-plugins-a","errorCode":null,"errorMessage":"Plugin '{plugin}' not found. Available plugins: {available}","messagePattern":"Plugin '(.+?)' not found\\. Available plugins: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"glances/outputs/glances_mcp.py","lineNumber":235,"sourceCode":"            return server._serialize(server._get_stats().getAllAsDict())\n\n        # ---- per-plugin stats (resource template) ------------------------\n\n        @mcp.resource(\n            \"glances://stats/{plugin}\",\n            name=\"plugin_stats\",\n            description=(\n                \"Current statistics for a specific monitoring plugin. \"\n                \"Fetch glances://plugins first to discover available plugin names.\"\n            ),\n            mime_type=\"application/json\",\n        )\n        def plugin_stats(plugin: str) -> str:\n            stats = server._get_stats()\n            plugin_obj = stats.get_plugin(plugin)\n            if plugin_obj is None:\n                available = stats.getPluginsList()\n                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\")","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_mcp.py#L217-L253","documentation":"The glances://stats/{plugin} MCP resource resolves the plugin name against the live stats manager; unknown names raise ValueError listing all available plugin names (e.g. cpu, mem, load...). It's a normal 'not found' error for an MCP client asking for a plugin that isn't loaded on this Glances instance.","triggerScenarios":"Requesting resource glances://stats/gpu on a machine without GPU plugin, or 'diskio' when disk monitoring plugins are disabled; typos like 'CPUS'; plugins disabled via config or --disable-plugin.","commonSituations":"MCP client (Claude/LLM tooling) hallucinating plugin names; copying plugin names from docs of a different platform (e.g. sensors only on Linux); instances started with a restricted plugin set.","solutions":["Read the error: it enumerates valid names — retry with one of them, or list them via glances://plugins.","Enable the plugin in glances.conf or remove it from disable_plugin if it should exist.","Verify interactively: glances CLI shows the same plugin set the MCP server exposes."],"exampleFix":"# before\nread glances://stats/gpu\n# ValueError: Plugin 'gpu' not found. Available plugins: ['cpu', 'mem', ...]\n\n# after\nread glances://stats/mem","handlingStrategy":"validation","validationCode":"names = stats.getPluginsList()  # or via glances://plugins\nif plugin not in names:\n    raise KeyError(f'{plugin} not in {names}')","typeGuard":"def plugin_exists(stats, name: str) -> bool:\n    return stats.get_plugin(name) is not None","tryCatchPattern":"try:\n    data = read(f'glances://stats/{plugin}')\nexcept ValueError as e:\n    available = ast.literal_eval(str(e).split('Available plugins: ')[1])\n    # retry with a corrected name","preventionTips":["Discover plugin names via glances://plugins before first use.","Match plugin names exactly and lowercase (cpu, mem, net).","Ensure the plugin is enabled on the target host's OS/config."],"tags":["mcp","plugin-not-found","resource-resolution"],"backgroundTag":"resource-not-found","analyzedSha":"a240d8dfb3105a38b5964357ec21768594b0e83e","analyzedAt":"2026-08-27T19:15:19.178Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}