Skip to main content
Glama

darwin_stats

Analyze and retrieve comprehensive statistics on nix-darwin configurations, including total options, category counts, and top categories, for informed system configuration decisions.

Instructions

Get statistics about nix-darwin options.

Retrieves overall statistics including total options, categories, and top categories.

Returns: Plain text summary with total options, category count, and top 5 categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The darwin_stats tool handler function. Fetches and parses the nix-darwin manual HTML to compute statistics on total options, categories, and top categories. Registered via @mcp.tool() decorator. No input parameters required.
    @mcp.tool() async def darwin_stats() -> str: """Get statistics about nix-darwin options. Retrieves overall statistics including total options, categories, and top categories. Returns: Plain text summary with total options, category count, and top 5 categories """ try: # Parse all options to get statistics options = parse_html_options(DARWIN_URL, limit=3000) if not options: return error("Failed to fetch nix-darwin statistics") # Count categories categories: dict[str, int] = {} for opt in options: cat = opt["name"].split(".")[0] categories[cat] = categories.get(cat, 0) + 1 # Count types types: dict[str, int] = {} for opt in options: opt_type = opt.get("type", "unknown") if opt_type: # Simplify complex types if "null or" in opt_type: opt_type = "nullable" elif "list of" in opt_type: opt_type = "list" elif "attribute set" in opt_type: opt_type = "attribute set" types[opt_type] = types.get(opt_type, 0) + 1 # Build statistics return f"""nix-darwin Statistics: • Total options: {len(options):,} • Categories: {len(categories)} • Top categories: - services: {categories.get("services", 0):,} options - system: {categories.get("system", 0):,} options - launchd: {categories.get("launchd", 0):,} options - programs: {categories.get("programs", 0):,} options - homebrew: {categories.get("homebrew", 0):,} options""" except Exception as e: return error(str(e))

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