Skip to main content
Glama

nixos_info

Retrieve detailed information about NixOS packages and configuration options to verify specifications and prevent configuration errors.

Instructions

Get detailed info about a NixOS package or option.

Args: name: Name of the package or option to look up type: Type of lookup - "package" or "option" channel: NixOS channel to search in (e.g., "unstable", "stable", "25.05")

Returns: Plain text details about the package/option or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
typeNopackage
channelNounstable

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The nixos_info tool handler function. It performs an exact lookup for a NixOS package or option using the Elasticsearch API on search.nixos.org, formats the results as plain text with details like version, description, homepage, license (for packages) or type, description, default, example (for options).
    async def nixos_info(name: str, type: str = "package", channel: str = "unstable") -> str:  # pylint: disable=redefined-builtin
        """Get detailed info about a NixOS package or option.
    
        Args:
            name: Name of the package or option to look up
            type: Type of lookup - "package" or "option"
            channel: NixOS channel to search in (e.g., "unstable", "stable", "25.05")
    
        Returns:
            Plain text details about the package/option or error message
        """
        info_type = type  # Avoid shadowing built-in
        if info_type not in ["package", "option"]:
            return error("Type must be 'package' or 'option'")
        channels = get_channels()
        if channel not in channels:
            suggestions = get_channel_suggestions(channel)
            return error(f"Invalid channel '{channel}'. {suggestions}")
    
        try:
            # Exact match query with correct field names
            field = "package_pname" if info_type == "package" else "option_name"
            query = {"bool": {"must": [{"term": {"type": info_type}}, {"term": {field: name}}]}}
            hits = es_query(channels[channel], query, 1)
    
            if not hits:
                return error(f"{info_type.capitalize()} '{name}' not found", "NOT_FOUND")
    
            src = hits[0].get("_source", {})
    
            if info_type == "package":
                info = []
                info.append(f"Package: {src.get('package_pname', '')}")
                info.append(f"Version: {src.get('package_pversion', '')}")
    
                desc = src.get("package_description", "")
                if desc:
                    info.append(f"Description: {desc}")
    
                homepage = src.get("package_homepage", [])
                if homepage:
                    if isinstance(homepage, list):
                        homepage = homepage[0] if homepage else ""
                    info.append(f"Homepage: {homepage}")
    
                licenses = src.get("package_license_set", [])
                if licenses:
                    info.append(f"License: {', '.join(licenses)}")
    
                return "\n".join(info)
    
            # Option type
            info = []
            info.append(f"Option: {src.get('option_name', '')}")
    
            opt_type = src.get("option_type", "")
            if opt_type:
                info.append(f"Type: {opt_type}")
    
            desc = src.get("option_description", "")
            if desc:
                # Strip HTML tags from description
                if "<rendered-html>" in desc:
                    desc = desc.replace("<rendered-html>", "").replace("</rendered-html>", "")
                    desc = re.sub(r"<[^>]+>", "", desc)
                    desc = desc.strip()
                info.append(f"Description: {desc}")
    
            default = src.get("option_default", "")
            if default:
                info.append(f"Default: {default}")
    
            example = src.get("option_example", "")
            if example:
                info.append(f"Example: {example}")
    
            return "\n".join(info)
    
        except Exception as e:
            return error(str(e))
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the tool returns 'plain text details' or an 'error message', which adds some behavioral context about output format. However, it lacks details on permissions, rate limits, or what specific information is included in the 'detailed info', leaving gaps for a mutation-free lookup tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by clear sections for Args and Returns. Every sentence earns its place by defining parameters and output without redundancy, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no annotations, but has an output schema), the description is mostly complete. It covers the purpose, parameters, and output format. However, it could improve by specifying error conditions or example outputs, though the output schema mitigates some of this need.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains all three parameters: 'name' (package/option to look up), 'type' (lookup type with examples), and 'channel' (NixOS channel with examples). This adds meaningful semantics beyond the bare schema, though it doesn't specify format constraints like valid channel names beyond examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get detailed info') and resource ('about a NixOS package or option'), distinguishing it from siblings like nixos_search (searching) or nixos_stats (statistics). It precisely defines what information is retrieved.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for looking up packages or options in NixOS channels, but provides no explicit guidance on when to use this tool versus alternatives like nixos_search or nixos_flakes_search. It mentions the tool's scope but lacks comparison with siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/utensils/mcp-nixos'

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