Skip to main content
Glama
awslabs
by awslabs

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:

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

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

  3. Trestle - Semantic checks via compliance-trestle 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
Behavior5/5

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

With no annotations, the description fully discloses the multi-level pipeline, skipping logic, graceful handling of missing dependencies, and remote URI restrictions. It also indicates the return type (structured dict). This level of detail compensates for the lack of annotations.

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?

Reasonably concise and well-structured with a main purpose followed by bullet-like levels. Each sentence adds value, though the description could be slightly tightened.

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

Completeness5/5

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

Given the tool's complexity (multi-level validation, conditional behavior), the description is thorough. It covers all failure modes, skipping rules, and the remote URI constraint. No output schema is provided, but the description adequately states the return structure.

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?

The description adds meaning beyond the bare schema: explains that file_uri can be local or remote but may fail without config, and that model_type is optional with auto-detection. This is valuable given 0% schema description coverage.

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

Purpose5/5

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

Clearly states the tool validates OSCAL JSON files through a multi-level pipeline. The verb 'validate' and resource 'OSCAL file' are specific, and the description distinguishes from siblings like 'validate_oscal_content' by detailing the multi-level approach.

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

Usage Guidelines4/5

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

Provides clear usage context: when to validate OSCAL files, handling of missing oscal-cli, and remote URI conditions. However, it does not explicitly mention when not to use this tool or suggest alternatives (e.g., 'validate_oscal_content' for lighter validation).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awslabs/mcp-server-for-oscal'

If you have feedback or need assistance with the MCP directory API, please join our Discord server