validate_oscal_file
Run multi-level validation on OSCAL JSON files, from JSON well-formedness to full NIST validation, returning structured per-level results.
Instructions
Validate OSCAL JSON file through a multi-level validation pipeline.
Runs up to four validation levels in sequence:
Well-formedness - Is it valid JSON and a JSON object?
JSON Schema - Does it conform to the NIST OSCAL JSON schema?
Trestle - Semantic checks via compliance-trestle Pydantic models
oscal-cli - Full NIST validation if oscal-cli is installed
If Level 1 fails, Levels 2-4 are skipped. If oscal-cli is not installed, Level 4 is gracefully skipped. The overall result is valid only when all non-skipped levels pass.
Args:
ctx: MCP server context (injected automatically by MCP server)
file_uri: URI of the file to be validated. This can be local or remote but remote URI will fail unless config.allow_remote_uris == True.
model_type: Optional OSCAL model type (e.g. "catalog", "profile").
If omitted, the model type is auto-detected from the root key.
Returns: dict: Structured validation results with per-level detail
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_uri | Yes | ||
| model_type | No |