Skip to main content
Glama
JEFF7712

nix-agent

by JEFF7712

switch

Activate NixOS or Home Manager configurations with optional dry-build validation, record rollback generation, and return units changed, package delta, systemd health, and generation before/after.

Instructions

Activate the configuration (sudo -n nixos-rebuild switch / home-manager switch). Records rollback_generation first. Returns a structured 'summary' (units changed, derivations built, package delta, systemd health, and a bounded warnings list from the captured switch log) plus gen before/after; on success the raw log is trimmed to a tail (pass full_log=True for all of it). Status is 'degraded' when activation succeeded but units newly failed. No implicit validation by default; pass validate=True to gate on check('dry-build') first. On a sudo auth failure returns a 'privilege' diagnosis. Local activation only; hosts requiring cluster cordon/drain and readiness gating must use their fleet orchestrator.

Input Schema

NameRequiredDescriptionDefault
modeNonixos
full_logNo
validateNo
flake_uriNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses that rollback_generation is recorded first, that the raw log is trimmed to a tail unless full_log=True, that status becomes 'degraded' when units newly fail, and that sudo auth failure yields a 'privilege' diagnosis. These are behaviors an agent could not infer from the schema alone.

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

Conciseness4/5

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

Dense and front-loaded — the core action and side effect (rollback generation) come first, then return shape, then the validate/privilege/local-only caveats. It is a single run-on paragraph, but essentially every clause carries decision-relevant information.

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

Completeness5/5

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

Output schema exists, yet the description still helpfully summarizes the return shape (summary fields, gen before/after) and degraded/privilege states. Combined with the mutation side effects and the local-only scope, an agent has everything needed to invoke it correctly.

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 full_log (default tail vs everything) and validate (gate on dry-build) with meaning beyond the bare types, and the two commands imply mode values. flake_uri is never addressed, leaving one of four parameters undocumented.

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?

States a specific verb and resource — 'Activate the configuration' — and names the concrete underlying commands (nixos-rebuild switch / home-manager switch). It also implicitly carves itself out from siblings like check and build by describing what activation does versus dry-run validation.

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

Usage Guidelines5/5

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

Explicitly tells the agent when to pass validate=True (to gate on check('dry-build')) and when not to (no implicit validation by default), and gives a hard exclusion: hosts requiring cluster cordon/drain and readiness gating must use their fleet orchestrator instead. That is a clear when/when-not/alternative triple.

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