Skip to main content
Glama

validate_oscal_file

Check OSCAL JSON files for well-formedness, schema conformance, semantic model validity, and optional NIST oscal-cli validation, with per-level results.

Instructions

Validate OSCAL JSON file through a multi-level validation pipeline.

Runs up to four validation levels in sequence:

  1. Well-formedness - Is it valid JSON and a JSON object?

  2. JSON Schema - Does it conform to the NIST OSCAL JSON schema?

  3. Model - Semantic checks via OSCAL Pydantic models

  4. 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

TableJSON Schema
NameRequiredDescriptionDefault
file_uriYes
model_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and largely meets it: it discloses short-circuit behavior, graceful skipping when oscal-cli is missing, and the config.allow_remote_uris == True constraint for remote URIs. It does not mention performance/rate traits or whether the call is read-only, but the operational behavior is well covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded summary sentence followed by a numbered level list that is easy to scan. The boilerplate 'Args: ctx: MCP server context (injected automatically)' line is noise, but the rest is tight and every section earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the Returns line ("Structured validation results with per-level detail") usefully fills that gap, and both parameters plus the pipeline semantics are covered. The one hole is failing to position the tool against validate_oscal_content.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and does: file_uri is documented as local-or-remote with the remote-URI constraint, and model_type is explained as optional with auto-detection from the root key. Only missing value-level detail (e.g. accepted model_type strings) keeps it from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ("Validate OSCAL JSON file") and enumerates the four validation levels, so the operation is unambiguous. However, it never distinguishes itself from the sibling validate_oscal_content, leaving the agent to guess which validator applies to content vs. a file URI.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the pipeline sequencing and skip conditions (Level 1 failure skips 2-4; oscal-cli absent skips Level 4), which implies how the tool behaves. But it gives no guidance on when to prefer this over validate_oscal_content, nor any prerequisites, so usage vs. alternatives is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.