Skip to main content
Glama
oscal-compass

Trestle MCP

Official

Convert CSV to OSCAL Component Definition

trestle_task_csv_to_oscal_cd

Convert a structured CSV into an OSCAL component definition JSON file to automate compliance documentation and control mapping.

Instructions

Convert a CSV file to an OSCAL component definition JSON file.

This tool runs the trestle task csv-to-oscal-cd command, which reads a specially formatted CSV file and produces an OSCAL component_definition .json file.

The CSV must have:

  • Row 1: column headings

  • Row 2: column descriptions

  • Row 3+: data rows

Required CSV columns:

  • $$Component_Title, $$Component_Description, $$Component_Type

  • $$Rule_Id, $$Rule_Description, $$Profile_Source, $$Profile_Description

  • $$Control_Id_List, $$Namespace

Args: params (TrestleTaskCsvToOscalCdInput): Input parameters with: - title (str): Component definition title (required) - version (str): Component definition version (required) - csv_file (str): Path to the input CSV file (required) - output_dir (str): Output directory for OSCAL JSON files (required) - component_definition (Optional[str]): Existing component-definition to update (optional) - output_overwrite (bool): Overwrite existing output (default: true) - validate_controls (str): Control validation mode: on/warn/off (default: off) - class_column_mappings (Optional[dict]): Column-to-class mappings (optional) - trestle_root (Optional[str]): Trestle workspace root path (optional) - verbose (bool): Display verbose output (optional)

Returns: str: Success or error message with output file location

Examples: - Use when: "Convert CSV to OSCAL component definition" - Use when: "Generate component_definition.json from a CSV mapping file" - Don't use when: Input CSV is missing required columns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations set readOnlyHint=false and destructiveHint=false, so no contradiction. Description explains it produces an output file and returns success/error message, but does not detail potential side effects or permissions beyond file creation.

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?

Well-structured with bullet points and examples, but could be slightly more concise. No redundant sentences.

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?

Comprehensively covers the tool's purpose, input requirements, output, and examples. With an output schema present, no need to describe return values in detail.

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 has detailed descriptions for each parameter, so the description adds moderate value by explaining the required CSV columns and overall workflow. Schema coverage is effectively high, so baseline applies.

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 clearly states the tool converts CSV to OSCAL component definition JSON. It specifies the command and the CSV format, distinguishing it from sibling trestle tools which handle catalog, profile, import, and init tasks.

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?

Includes explicit 'Use when' and 'Don't use when' examples, providing context for appropriate usage. Does not explicitly compare to sibling tools, but the task is specific enough.

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/oscal-compass/compliance-trestle-mcp'

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