Skip to main content
Glama
Trestle MCP

Trestle MCP

Official

Validate OSCAL Document

trestle_validate
Read-onlyIdempotent

Validate a standalone OSCAL file against the OSCAL schema, and optionally run semantic checks for duplicate UUIDs, broken references, links, and rule parameters.

Instructions

Validate a standalone OSCAL file against the OSCAL schema.

This tool loads the OSCAL document through the trestle model classes, which enforces the OSCAL schema (required fields, field types, enums, UUID formats, and nesting). Optionally it also runs trestle's semantic validators (duplicate UUIDs, broken internal references, links, and rule parameters).

It detects the model type from the file's single top-level wrapper key, so it validates any top-level OSCAL model: catalog, profile, component-definition, system-security-plan, assessment-plan, assessment-results, mapping-collection, or plan-of-action-and-milestones -- the same list as model_type elsewhere in this server.

Unlike trestle validate on the CLI, this works on a standalone file that is not part of a trestle workspace — for example a POA&M JSON produced by an authoring flow.

Args: params (TrestleValidateInput): Input parameters with: - file (str): Path to the OSCAL .json/.yaml/.yml file (required) - expected_model_type (Optional[str]): Enforce the file is this model type (e.g. 'plan-of-action-and-milestones') - semantic (bool): Run semantic validators too (default: true)

Returns: str: A pass/fail message; on failure, the concrete reasons.

Examples: - Use when: "Validate this POA&M JSON is valid OSCAL" file="./poam.json", expected_model_type="plan-of-action-and-milestones" - Use when: "Check that catalog.json conforms to the OSCAL schema" - Don't use when: The file is inside a trestle workspace and you want the full trestle validate workspace checks.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "params": "<params>"
    },
    "name": "trestle_validate"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • changedInput schema / $defs / TrestleValidateInput / properties / expected_model_type / description
      Previous value: -"If set, the file must be this OSCAL model type or validation fails. One of: ['assessment-plan', 'assessment-results', 'catalog', 'component-definition', 'plan-of-action-and-milestones', 'profile', 'system-security-plan']. For a POA&M, pass 'plan-of-action-and-milestones'."New value: +"If set, the file must be this OSCAL model type or validation fails. One of: ['assessment-plan', 'assessment-results', 'catalog', 'component-definition', 'mapping-collection', 'plan-of-action-and-milestones', 'profile', 'system-security-plan']. For a POA&M, pass 'plan-of-action-and-milestones'."
  2. Addedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, but the description adds meaningful context: loading through trestle model classes, schema enforcement details, optional semantic validators, model-type detection, and pass/fail return behavior. The only minor ambiguity is calling semantic validation 'optional' while also stating it defaults to true.

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?

The description is long but well front-loaded: purpose first, then behavior, parameter details, return behavior, and examples. Some content, such as the full model-type list and validator details, overlaps with schema information, but the structure keeps it usable.

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 that annotations cover safety and an output schema exists, the description supplies the remaining context an agent needs: validation depth, semantic checks, model detection, standalone-file scope, and the workspace exclusion. It is complete for a read-only validation tool.

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

Parameters3/5

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

The input schema already documents the nested parameters and their meanings, including the default for `semantic` and the allowed model-type values. The description restates those parameters with little additional semantic detail beyond noting that model type is detected from the top-level key.

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?

The description states a specific verb and resource: validate a standalone OSCAL file against the OSCAL schema. It also distinguishes this from `trestle validate` on the CLI by emphasizing that it works on files outside a trestle workspace, which gives an agent a clear scope.

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

Usage Guidelines5/5

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

It provides explicit 'Use when' examples and a 'Don't use when' condition for files inside a trestle workspace needing full workspace checks. The alternatives and exclusions are directly stated rather than implied.

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