nicolargo/glances · warning · ValueError

Plugin '{plugin}' not found. Available plugins: {available}

Error message

Plugin '{plugin}' not found. Available plugins: {available}

What it means

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.

Source

Thrown at glances/outputs/glances_mcp.py:235

            return server._serialize(server._get_stats().getAllAsDict())

        # ---- per-plugin stats (resource template) ------------------------

        @mcp.resource(
            "glances://stats/{plugin}",
            name="plugin_stats",
            description=(
                "Current statistics for a specific monitoring plugin. "
                "Fetch glances://plugins first to discover available plugin names."
            ),
            mime_type="application/json",
        )
        def plugin_stats(plugin: str) -> str:
            stats = server._get_stats()
            plugin_obj = stats.get_plugin(plugin)
            if plugin_obj is None:
                available = stats.getPluginsList()
                raise ValueError(f"Plugin '{plugin}' not found. Available plugins: {available}")
            return server._serialize(plugin_obj.get_raw())

        # ---- per-plugin history (resource template) ----------------------

        @mcp.resource(
            "glances://stats/{plugin}/history",
            name="plugin_history",
            description=(
                "Historical time-series data for a specific monitoring plugin. "
                "Returns a dict of field→list pairs, most-recent value last."
            ),
            mime_type="application/json",
        )
        def plugin_history(plugin: str) -> str:
            stats = server._get_stats()
            plugin_obj = stats.get_plugin(plugin)
            if plugin_obj is None:
                raise ValueError(f"Plugin '{plugin}' not found")

View on GitHub (pinned to a240d8dfb3)

Solutions

  1. Read the error: it enumerates valid names — retry with one of them, or list them via glances://plugins.
  2. Enable the plugin in glances.conf or remove it from disable_plugin if it should exist.
  3. Verify interactively: glances CLI shows the same plugin set the MCP server exposes.

Example fix

# before
read glances://stats/gpu
# ValueError: Plugin 'gpu' not found. Available plugins: ['cpu', 'mem', ...]

# after
read glances://stats/mem
Defensive patterns

Strategy: validation

Validate before calling

names = stats.getPluginsList()  # or via glances://plugins
if plugin not in names:
    raise KeyError(f'{plugin} not in {names}')

Type guard

def plugin_exists(stats, name: str) -> bool:
    return stats.get_plugin(name) is not None

Try / catch

try:
    data = read(f'glances://stats/{plugin}')
except ValueError as e:
    available = ast.literal_eval(str(e).split('Available plugins: ')[1])
    # retry with a corrected name

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nicolargo/glances@a240d8dfb3 (2026-08-27). Data as JSON: /api/errors/ab96d9788b21a6cc. Report an issue: GitHub.