collect_template_input
Collect and validate template-based configuration inputs for compliance automation. Processes JSON, YAML, TOML, and XML formats, verifies required fields, and manages file storage or memory references with mandatory user confirmation.
Instructions
Collect user input for template-based task inputs.
TEMPLATE INPUT PROCESSING (Enhanced with Progressive Saving):
Validates user content against template format (JSON/TOML/YAML)
Handles JSON arrays and objects properly
Checks for required fields from template structure
Uploads validated content as file (ONLY for FILE dataType inputs)
Returns file URL for use in rule structure
MANDATORY: Gets final confirmation for EVERY input before proceeding
CRITICAL: Only processes user-provided content, never use default templates
NEW: Prepared for automatic rule updates in confirm step
JSON ARRAY HANDLING (Preserved):
Properly validates JSON arrays: [{"key": "value"}, {"key": "value"}]
Validates JSON objects: {"key": "value", "nested": {"key": "value"}}
Handles complex nested structures with arrays and objects
Validates each array element and object property
VALIDATION REQUIREMENTS (Preserved):
JSON: Must be valid JSON (arrays/objects) with proper brackets and quotes
TOML: Must follow TOML syntax with proper sections [section_name]
YAML: Must have correct indentation and structure
XML: Must be well-formed XML with proper tags
Required fields: All template fields must be present in user content
STREAMLINED WORKFLOW:
User provides template content
Validate and process immediately
Auto-proceed if validation passes
FILE NAMING CONVENTION (Preserved):
Format: {task_name}_{input_name}.{extension}
Extensions: .json, .toml, .yaml, .xml, .txt based on format
WORKFLOW INTEGRATION (Enhanced):
Called after get_template_guidance() shows template to user
User provides their actual configuration content
This tool validates content (including JSON arrays)
Shows content preview and asks for confirmation
Only after confirmation: uploads file or stores in memory
Returns file URL or memory reference for rule structure
NEW: Prepared for rule update in confirm_template_input()
CRITICAL RULES (Preserved):
ONLY upload files for inputs with dataType = "FILE" or "HTTP_CONFIG"
Template inputs and HTTP_CONFIG inputs are typically file types and need file uploads
Store non-FILE template content in memory
ALWAYS get final confirmation before proceeding
Handle JSON arrays properly: validate each element
Never use template defaults - always use user-provided content
MANDATORY: Task-sequential collection only. Sanitize input names (alphanumeric + underscore).
Args: task_name: Name of the task this input belongs to input_name: Name of the input parameter user_content: Content provided by the user based on the template
Returns: Dict containing validation results and file URL or memory reference, prepared for progressive rule updates
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_name | Yes | ||
| input_name | Yes | ||
| user_content | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||