# Validate — canonical payload contracts

Offline validators for JSON, JSON Schema, XML, CSV, URL, IBAN, EU VAT (checksum), and Hungarian tax/company numbers. No email (use email service); no VIES.

**Service id:** `validate`  
**Docs:** [https://mcp.glc-rag.hu/guide/validate](https://mcp.glc-rag.hu/guide/validate)  
**Markdown docs:** [https://mcp.glc-rag.hu/guide/validate.md](https://mcp.glc-rag.hu/guide/validate.md)  
**MCP resource:** `docs://validate/payload`

POST `https://mcp.glc-rag.hu/mcp`. Values below are **type slots** from the live input schema (e.g. `<string, required>`), not example data. Fill them from the user task.

RPC result wrapper: `result.structuredContent` is the object in **Output schema**. `result.isError` mirrors `structuredContent.is_error`.

## `validate_json`

Parse JSON text; return valid=true or decode errors with line/col.

**Required arguments:** `json`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_json",
    "arguments": {
      "json": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "json": {
      "type": "string",
      "description": "JSON text to parse"
    }
  },
  "required": [
    "json"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_json_schema`

Validate a JSON instance against a JSON Schema (Draft 2020-12). Both arguments are JSON text.

**Required arguments:** `instance`, `schema`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_json_schema",
    "arguments": {
      "instance": "<string, required>",
      "schema": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "instance": {
      "type": "string",
      "description": "JSON instance text"
    },
    "schema": {
      "type": "string",
      "description": "JSON Schema text"
    }
  },
  "required": [
    "instance",
    "schema"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_xml`

Check that XML text is well-formed (no XSD in v1).

**Required arguments:** `xml`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_xml",
    "arguments": {
      "xml": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "xml": {
      "type": "string",
      "description": "XML document text"
    }
  },
  "required": [
    "xml"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_csv`

Parse CSV; check delimiter, optional header, column consistency.

**Required arguments:** `csv`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_csv",
    "arguments": {
      "csv": "<string, required>",
      "delimiter": "<string, optional, minLength 1, maxLength 1>",
      "has_header": "<boolean, optional, default True>",
      "expected_columns": "<integer, optional, minimum 1, maximum 1000>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "csv": {
      "type": "string",
      "description": "CSV text"
    },
    "delimiter": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "Force delimiter (default: sniff , ; tab |)"
    },
    "has_header": {
      "type": "boolean",
      "default": true
    },
    "expected_columns": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000
    }
  },
  "required": [
    "csv"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_url`

Validate URL form. Optional require_public=true applies the same SSRF/public host policy as fetch/staging (no download).

**Required arguments:** `url`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_url",
    "arguments": {
      "url": "<string, required>",
      "schemes": [
        "<string, optional>"
      ],
      "require_public": "<boolean, optional, default False>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "schemes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Allowed schemes (default http, https)"
    },
    "require_public": {
      "type": "boolean",
      "default": false,
      "description": "Reject private/localhost hosts"
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_iban`

Validate IBAN format and mod-97 checksum; return compact normalized form.

**Required arguments:** `iban`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_iban",
    "arguments": {
      "iban": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "iban": {
      "type": "string"
    }
  },
  "required": [
    "iban"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_vat_number`

Validate EU VAT number format and country checksum offline. Does NOT call VIES — not proof of registration.

**Required arguments:** `vat`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_vat_number",
    "arguments": {
      "vat": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "vat": {
      "type": "string",
      "description": "e.g. HU12345678"
    }
  },
  "required": [
    "vat"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_hungarian_tax_number`

Validate Hungarian adószám (8-digit checksum + optional -VAT-county).

**Required arguments:** `tax_number`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_hungarian_tax_number",
    "arguments": {
      "tax_number": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "tax_number": {
      "type": "string",
      "description": "e.g. 12892312-1-42 or 11 digits"
    }
  },
  "required": [
    "tax_number"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_hungarian_company_number`

Validate Hungarian cégjegyzékszám form CC-FF-NNNNNN (e.g. 01-09-123456).

**Required arguments:** `company_number`

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_hungarian_company_number",
    "arguments": {
      "company_number": "<string, required>"
    }
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "company_number": {
      "type": "string"
    }
  },
  "required": [
    "company_number"
  ],
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    },
    "normalized": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```

## `validate_status`

Validate service health and limits.

**Required arguments:** _(none)_

**Request contract**

```json
{
  "jsonrpc": "2.0",
  "id": "<integer|string>",
  "method": "tools/call",
  "params": {
    "name": "validate_status",
    "arguments": {}
  }
}
```

**Input schema**

```json
{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
```

**Output schema** (`structuredContent` on success)

```json
{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    }
  },
  "additionalProperties": true,
  "required": [
    "ok"
  ]
}
```

**Error object**

```json
{
  "type": "object",
  "required": [
    "error",
    "is_error"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "is_error": {
      "type": "boolean",
      "const": true
    }
  },
  "additionalProperties": true
}
```
