# Ismn validate

`ismn-validate` · version 1.0.0 · Identifiers & check digits · free, no key needed

Validate an ISMN's EAN mod 10 check digit in M-form or 979-0 form and return the canonical 13-digit form.

**Use when you need to: validate an ismn · check ismn check digit · convert m-form ismn to 979-0.**

## Decide before calling

Read the [versioned contract](/v1/tools/ismn-validate/versions/1.0.0) and the supported scope below. Reuse `ismn-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 `ismn-validate@1.0.0` for validate an ismn. 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 an ismn
- check ismn check digit
- convert m-form ismn to 979-0
- is this music publication number valid
- ismn checksum validator
- verify sheet music identifier
- is 979-0 a valid isbn prefix

## Not supported

- looking up which publication an ISMN actually identifies
- validating an ISBN or ISSN (see isbn-validate / issn-validate)
- accepting a 979-0 form with the M-form prefix mixed in

## Behavior

- Normalization: remove every '-' and ' ' from ismn first; the 17-byte limit and 1-byte minimum apply to the original, unstripped ismn.
- Character counting: every length, position and 'character' counts Unicode code points, not UTF-16 code units, so the echoed ismn13 and check_digit never split a surrogate pair.
- Two stripped lengths are accepted: 10 (M-form: character 1 must be literal 'M', characters 2-10 are 9 digits including the check digit) or 13 (all digits, current form). Any other stripped length is reason wrong_length, checked first.
- 13-digit-form only: once the charset passes, characters 1-4 must be '9790', else reason unknown_prefix.
- ismn13 and check_digit are always reconstructed from the raw positions whenever the stripped length is 10 or 13, regardless of charset, prefix or check-digit validity; both are null only when length already failed. For M-form, ismn13 is 9790 + characters 2-9 + a freshly computed check digit (computable once characters 2-9 are digits); for the 13-digit form, ismn13 is simply the stripped input.
- Check digit (evaluated only once the charset, and for the 13-digit form the prefix, both pass): weight the first 12 digits (of the 13-digit form, or of 9790+characters2-9 for M-form) alternately 1,3,... (the isbn13/EAN-13 rule); a mismatch with the actual 13th digit (or M-form character 10) is reason check_digit_mismatch.
- valid is true only when length, charset, (for the 13-digit form) the prefix, and the check digit all pass, in that order; only one reason is ever returned.

## Input

- `ismn` (string, required): min length 1; max length 17

## Output

- `valid` (boolean, required)
- `reason` (one of null, "wrong_length", "invalid_character", "unknown_prefix", "check_digit_mismatch", required)
- `ismn13` (string or null, required): min length 13; max length 13
- `check_digit` (string or null, required): min length 1; max length 1

## Limits

- max ismn bytes: 17

## Example

Request input:

```json
{
  "ismn": "M-2306-7118-7"
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": null,
    "ismn13": "9790230671187",
    "check_digit": "7"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "ismn-validate",
  "version": "1.0.0",
  "input": {
    "ismn": "M-2306-7118-7"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/ismn-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"ismn":"M-2306-7118-7"}'
```

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

### CLI

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

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

## Related tools

- [Isin validate](/tools/isin-validate): Validate a 12-character ISIN's ISO 6166 Luhn check digit and parse its country prefix, NSIN and NSIN scheme.
- [Issn validate](/tools/issn-validate): Validate an 8-digit ISSN's mod 11 check digit (X allowed) and compute its 977-prefixed EAN-13 barcode form.
- [Checkdigit validate](/tools/checkdigit-validate): Validate a full value's trailing check digit(s) against a named algorithm (Luhn, Verhoeff, Damm, ISO 7064, GS1, mod 10).
- [Figi validate](/tools/figi-validate): Validate a 12-character FIGI's structure, forbidden-prefix rule and Modulus 10 Double Add Double check digit.
- [Iccid validate](/tools/iccid-validate): Validate a 19/20-digit ICCID's Luhn check digit, require the 89 major industry id, split issuer/account digits.
- [Imo number validate](/tools/imo-number-validate): Validate a 7-digit IMO ship identification number's weighted mod-10 check digit, with or without the 'IMO ' prefix.
