Skip to main content
Glama

Check Nix Syntax

syntax_check
Read-onlyIdempotent

Parse one or more Nix files without evaluating or building them, catching syntax errors before evaluation. Use it to validate file syntax safely via nix-instantiate --parse.

Instructions

Parse one or more Nix files without evaluating or building them. Uses nix-instantiate --parse for compatibility.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "files": "<files>"
    },
    "name": "syntax_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory under an MCP workspace root.
filesYes
timeoutSecondsNo

Output Schema

NameRequiredDescriptionDefault
runIdYes
statusYes
outputsYes
summaryYes
diagnosticsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world, so the safety profile is covered. The description adds genuine context beyond that by naming the underlying mechanism (nix-instantiate --parse), which tells the agent nothing is evaluated or written to the store. It omits any mention of the potentially long 1800s default timeout, which is the one behavioral detail left uncovered.

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?

Two short sentences, lead sentence front-loads the action and the key constraint, and the second sentence carries a non-redundant implementation note. No filler or restatement of the title.

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?

With an output schema present, the description need not explain return values, and the read-only, idempotent nature is fully covered by annotations. The remaining gap is the undocumented timeoutSeconds behavior, which matters for a tool that may legitimately run for up to 30 minutes by default.

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

Parameters3/5

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

Schema description coverage is only 33%: cwd is documented in the schema, but files and timeoutSeconds are not. The phrase 'one or more Nix files' usefully conveys that files accepts a batch (consistent with minItems=1), but the timeoutSeconds parameter — including its 30-minute default and 86400 ceiling — is neither in the schema nor the description, so compensation is partial.

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 (parse) and resource (one or more Nix files) and immediately bounds the scope with 'without evaluating or building them,' which cleanly separates it from the eval and build siblings. An agent can identify the tool's job from the first sentence alone.

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

Usage Guidelines4/5

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

The 'without evaluating or building them' clause gives an implicit when-not rule that steers the agent away from eval/build for pure syntax validation. It never names an alternative tool explicitly or states prerequisites (e.g., that files must be inside a workspace root), so it falls short of a full when/when-not/alternatives treatment.

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