# INI win validate

`ini-win-validate` · version 1.0.0 · Structured formats · free, no key needed

Check initialization-file text against the pinned Windows profile grammar.

**Use when you need to: validate windows initialization profile · check private profile grammar · windows profile syntax report.**

## Decide before calling

Read the [versioned contract](/v1/tools/ini-win-validate/versions/1.0.0) and the supported scope below. Reuse `ini-win-validate@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `ini-win-validate@1.0.0` for validate windows initialization profile. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- validate windows initialization profile
- check private profile grammar
- windows profile syntax report
- find unsupported profile line
- count duplicate profile keys
- verify initialization section form
- private profile structure report
- detect invalid section header

## Not supported

- return the retrieved profile string
- rewrite the profile into canonical text
- open Win.ini with GetProfileString

## Behavior

- Grammar getprivateprofilestring-pinned-1, the same line rules as ini-win-parse. A well-typed profile that breaks those rules returns valid false with a snake_case reason and a 1-based line. It does not throw.
- Duplicate section headers and duplicate keys inside one span are valid. duplicate_sections and duplicate_keys count the extra occurrences. Counts on an invalid file include only lines accepted before the failing line.
- Semicolon comments, hash comments, and colon separators are unsupported lines, not silently skipped. A line before the first section that contains = is key_before_section.
- Limits, wrong types, unknown fields, and lone surrogates throw. valid true uses reason "" and line 0. An empty text is a valid profile with no sections.

## Input

- `text` (string, required): max length 4096

## Output

- `grammar` (constant "getprivateprofilestring-pinned-1", required)
- `valid` (boolean, required)
- `reason` (one of "", "semicolon_comment", "hash_comment", "colon_separator", "unsupported_control", "unclosed_section", "trailing_section_junk", "empty_section_name", "empty_key_name", "key_before_section", "invalid_line", required)
- `line` (integer, required): min 0; max 200
- `section_count` (integer, required): min 0; max 32
- `key_count` (integer, required): min 0; max 128
- `duplicate_sections` (integer, required): min 0; max 32
- `duplicate_keys` (integer, required): min 0; max 128

## Limits

- max input bytes: 4096
- max lines: 200
- max sections: 32
- max keys: 128
- max name chars: 64
- max value chars: 512
- max depth: 8
- max nodes: 1024
- max output bytes: 512

## Example

Request input:

```json
{
  "text": "[section]\nkey=string\n"
}
```

Response:

```json
{
  "result": {
    "grammar": "getprivateprofilestring-pinned-1",
    "valid": true,
    "reason": "",
    "line": 0,
    "section_count": 1,
    "key_count": 1,
    "duplicate_sections": 0,
    "duplicate_keys": 0
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "ini-win-validate",
  "version": "1.0.0",
  "input": {
    "text": "[section]\nkey=string\n"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/ini-win-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"[section]\nkey=string\n"}'
```

The machine-readable contract is at [/v1/tools/ini-win-validate/versions/1.0.0](/v1/tools/ini-win-validate/versions/1.0.0).

### CLI

```sh
node cli.mjs run ini-win-validate 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [INI win format](/tools/ini-win-format): Format sections and keys into stable Windows initialization-file text.
- [INI win parse](/tools/ini-win-parse): Retrieve a Windows profile string, or list section or key names, with pinned profile rules.
- [Toml10 validate](/tools/toml10-validate): Check a TOML 1.0 document and locate the first structural error.
- [Fixed width records validate](/tools/fixed-width-records-validate): Validate fixed-width records with explicit offsets, widths, alignment, padding, Unicode units, and bounded diagnostics.
- [XML exc c14n validate](/tools/xml-exc-c14n-validate): Check whether XML is already in Exclusive XML Canonicalization 1.0 form.
- [Systemd .env parse](/tools/systemd-env-parse): Parse a systemd EnvironmentFile into assignments, a last-wins map, and duplicate keys.
