Skip to main content
Glama
Trestle MCP

Trestle MCP

Official

Convert CSV to OSCAL Component Definition

trestle_task_csv_to_oscal_cd
Destructive

Converts a specially formatted CSV file into an OSCAL component definition JSON file for compliance workflows.

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

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_task_csv_to_oscal_cd"
  }
}

Input Schema

NameRequiredDescriptionDefault
paramsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description adds real context beyond them: output_overwrite defaults to true (existing files replaced) and component_definition can point at an existing OSCAL file that gets updated. It also states the return value is a success/error message with output location. It stops short of warning about what is lost when overwriting or what permissions/workspace state (trestle_root) must exist.

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

Conciseness3/5

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

The CSV row-layout and required-column list is genuinely useful and front-loaded, but the Args block duplicates the input schema field-by-field and the Examples section repeats the title twice. Roughly half the text could be removed with no loss of information for an agent that can read the schema.

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?

For a task-runner tool, the definition covers the essential operational facts: input CSV shape, mandatory columns, required vs optional parameters, overwrite behavior, and return type. An output schema exists so return-value detail is not required, and the remaining gap is minor — no mention of error conditions beyond the CSV-column precondition.

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 Args block enumerates all ten parameters with types, requiredness, and defaults, which compensates for the reported low schema coverage at a surface level. However, it largely restates the schema's own property descriptions verbatim rather than adding meaning — for example, the on/warn/off semantics of validate_controls and the structure of class_column_mappings are not elaborated beyond what the schema already says.

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?

The first sentence gives a specific verb and resource pair: convert a CSV file into an OSCAL component definition JSON file, and it names the underlying trestle task (csv-to-oscal-cd). The output artifact name implicitly separates it from siblings such as trestle_task_csv_to_oscal_mc or trestle_task_xlsx_to_oscal_poam, but no sibling is named explicitly to confirm the distinction.

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

Usage Guidelines2/5

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

The 'Use when' examples merely restate the tool name ('Convert CSV to OSCAL component definition'), adding no decision criteria. The single 'Don't use when' entry is a precondition about CSV validity rather than routing guidance, and no alternative tool is mentioned for adjacent tasks like markdown catalog conversion or POA&M generation.

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