> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Checker Tools

> Data validation and checking tools for quality assurance

## Overview

Checker Tools provide comprehensive data validation and quality assurance capabilities. These tools help ensure data integrity, compliance with business rules, and automated quality control in your workflows.

## Key Features

### CHECKER\_CHECK\_BY\_JSON

* Uses an LLM to check text against rules defined as a JSON array
* Each rule can include a `name`, `description`, optional `references`, and optional few-shot `examples`
* Detailed validation results with reasons
* Inputs: `text` (text to check), `task` (task name), `description` (optional task description), `rules` (JSON array of rules)

### CHECKLIST

* Uses an LLM to evaluate whether the input text complies with each rule defined in a CSV file
* CSV columns: `name`, `description`, optional `references` (semicolon-separated), optional `examples` (JSON)
* Structured validation reporting
* Inputs: `text` (text to check), `task` (task name), `description` (optional task description), `rules` (URL of the CSV rules file)

### JINBA\_MODULES\_CHECKER\_V2

* Advanced validation using JSON rule files
* Enhanced rule processing
* Improved performance and accuracy
* Version 2 with additional features

## Authentication

No authentication required for checker tools.

## Example: Document Validation

```yaml theme={null}
- id: validate_document
  name: validate_document
  tool: CHECKER_CHECK_BY_JSON
  input:
    - name: text
      value: "{{steps.extract_document.result.content}}"
    - name: task
      value: "Contract Compliance Check"
    - name: description
      value: "Validate contract document against legal requirements"
    - name: rules
      value: |
        [
          {
            "name": "Must contain signature section",
            "description": "The document must contain a signature section (e.g. 'signature', 'sign here', 'executed by')."
          },
          {
            "name": "Must include termination clause",
            "description": "The document must include a termination clause describing how the agreement ends or expires."
          },
          {
            "name": "Should specify payment terms",
            "description": "The document should specify payment terms such as invoicing, billing, or due dates."
          }
        ]
```

## Example: Data Quality Validation

```yaml theme={null}
- id: extract_data
  name: extract_data
  tool: EXCEL_GET_ROWS
  input:
    - name: file_url
      value: "{{steps.input_file.result.file_url}}"
    - name: range
      value: "A1:E100"

- id: validate_data_quality
  name: validate_data_quality
  tool: CHECKER_CHECK_BY_JSON
  input:
    - name: text
      value: "{{steps.extract_data.result.content | join('\n')}}"
    - name: task
      value: "Customer Data Validation"
    - name: rules
      value: |
        [
          {
            "name": "Email format validation",
            "description": "Every email address must follow a valid email format (e.g. user@example.com)."
          },
          {
            "name": "Phone number format",
            "description": "Every phone number must be a valid international phone number."
          },
          {
            "name": "Complete address information",
            "description": "Each record should contain complete address information (street, city, etc.)."
          }
        ]

- id: process_validation_results
  name: process_validation_results
  tool: PYTHON_SANDBOX_RUN
  input:
    - name: code
      value: |
        import json
        
        validation_results = {{steps.validate_data_quality.result}}
        
        # Count validation status
        accepted = sum(1 for r in validation_results if r['status'] == 'accepted')
        rejected = sum(1 for r in validation_results if r['status'] == 'rejected')
        pending = sum(1 for r in validation_results if r['status'] == 'pending')
        
        print(f"Validation Summary:")
        print(f"✅ Accepted: {accepted}")
        print(f"❌ Rejected: {rejected}")
        print(f"⏳ Pending: {pending}")
        
        # List rejected items with reasons
        if rejected > 0:
            print("\nRejected Items:")
            for result in validation_results:
                if result['status'] == 'rejected':
                    print(f"- {result['rule']}: {result['reason']}")
```

## Example: Advanced File Validation

```yaml theme={null}
- id: upload_rules_file
  name: upload_rules_file
  tool: INPUT_FILE
  input:
    - name: description
      value: "Upload validation rules CSV file"

- id: validate_with_checklist
  name: validate_with_checklist
  tool: CHECKLIST
  input:
    - name: text
      value: "{{steps.input_data.result}}"
    - name: task
      value: "Batch Data Validation"
    - name: rules
      value: "{{steps.upload_rules_file.result}}"

- id: advanced_validation
  name: advanced_validation
  tool: JINBA_MODULES_CHECKER_V2
  input:
    - name: target_file
      value: "{{steps.input_data.result.file_url}}"
    - name: task
      value: "Advanced Data Validation"
    - name: description
      value: "Comprehensive validation using enhanced checker v2"
    - name: rules
      value: |
        [
          {
            "uniqueId": "email_check",
            "name": "Email format validation",
            "description": "Every email address must follow a valid email format (e.g. user@example.com)."
          },
          {
            "uniqueId": "age_check",
            "name": "Age range validation",
            "description": "Every age value must be a number between 18 and 120."
          },
          {
            "uniqueId": "country_check",
            "name": "Country code validation",
            "description": "Every country code must be one of US, UK, CA, AU, or JP."
          }
        ]
    - name: additionalDataSchema
      value: |
        {
          "extractedData": {
            "type": "object",
            "properties": {
              "email": {"type": "string"},
              "age": {"type": "number"},
              "country": {"type": "string"}
            }
          }
        }
```

## Validation Rule Types

### Pattern-based Rules

* **Regex patterns**: Use regular expressions for complex validation
* **Text matching**: Simple text presence or absence checks
* **Format validation**: Email, phone, URL, date formats

### Structural Rules

* **Required fields**: Ensure mandatory data is present
* **Data types**: Validate numeric, date, boolean data
* **Range validation**: Min/max values, length constraints

### Business Rules

* **Custom logic**: Complex business rule validation
* **Cross-field validation**: Rules that depend on multiple fields
* **Conditional rules**: Rules that apply under certain conditions

## Validation Results

Each validation returns an array of structured results:

```json theme={null}
{
  "rule": "Email format validation",
  "status": "accepted|rejected|pending",
  "range": [0, 120],
  "reason": "Detailed explanation of validation result"
}
```

`range` is an array of numbers indicating the character range the result applies to.

## Use Cases

* **Data Quality Assurance**: Validate imported data quality
* **Compliance Checking**: Ensure documents meet regulatory requirements
* **Form Validation**: Validate user-submitted forms and applications
* **Content Moderation**: Check content against community guidelines
* **Business Rule Enforcement**: Ensure data meets business criteria
* **Import Validation**: Validate data before importing into systems
* **Document Review**: Automated document compliance checking
