# Imo number validate

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

Validate a 7-digit IMO ship identification number's weighted mod-10 check digit, with or without the 'IMO ' prefix.

**Use when you need to: validate an imo ship number · check digit for imo number · is this imo number valid.**

## Decide before calling

Read the [versioned contract](/v1/tools/imo-number-validate/versions/1.0.0) and the supported scope below. Reuse `imo-number-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 `imo-number-validate@1.0.0` for validate an imo ship number. 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 imo ship number
- check digit for imo number
- is this imo number valid
- verify a vessel identification number
- imo number checksum calculator
- strip the imo prefix and validate the digits

## Not supported

- a live IMO GISIS ship-registry lookup
- validating an IMO company or registered owner number (a different scheme)
- lowercase "imo " or a prefix without the trailing space (not recognized, evaluated as the whole candidate)

## Behavior

- Only the exact 4-character literal prefix "IMO " (capital I, M, O, one space) is stripped, giving the candidate; any other form (lowercase, missing space) is left as the whole candidate, evaluated below unchanged.
- candidate.length != 7 returns reason wrong_length; length 7 but not all-digit returns reason invalid_character; both leave number/check_digit null.
- number = candidate, check_digit = candidate[6], populated once length and charset pass.
- Weighted sum over positions 1-6: digit * weight, weight = [7, 6, 5, 4, 3, 2]. expected check digit = sum mod 10, compared to check_digit for reason check_digit_mismatch.

## Input

- `imo` (string, required): min length 1; max length 11

## Output

- `valid` (boolean, required)
- `reason` (one of null, "wrong_length", "invalid_character", "check_digit_mismatch", required)
- `number` (string or null, required): pattern `^[0-9]{7}$`
- `check_digit` (string or null, required): pattern `^[0-9]$`

## Limits

- max imo bytes: 11

## Example

Request input:

```json
{
  "imo": "IMO 9074729"
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reason": null,
    "number": "9074729",
    "check_digit": "9"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "imo-number-validate",
  "version": "1.0.0",
  "input": {
    "imo": "IMO 9074729"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/imo-number-validate/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"imo":"IMO 9074729"}'
```

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

### CLI

```sh
node cli.mjs run imo-number-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.
- [Upu s10 validate](/tools/upu-s10-validate): Validate a 13-char UPU S10 postal identifier's weighted mod-11 check digit, split service indicator and country.
- [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.
- [Iso6346 container validate](/tools/iso6346-container-validate): Validate an 11-character ISO 6346 container number's mod-11 check digit and split the owner code, category and serial.
- [Ismn validate](/tools/ismn-validate): Validate an ISMN's EAN mod 10 check digit in M-form or 979-0 form and return the canonical 13-digit form.
- [Lei validate](/tools/lei-validate): Validate a 20-character LEI's ISO/IEC 7064 MOD 97-10 check digits and parse its LOU prefix and entity part.
