Skip to main content
Type validators check the type and format of values, ensuring data conforms to expected structures.
Type validators generally don’t use transforms since they check data types rather than string content. See Validators Overview for transform documentation.

not_null!

Checks that a value exists and is not null/None.
output:
  not_null!: true
ParameterTypeDescription
valuebooleantrue to require non-null, false to require null
# Ensure output exists
output:
  not_null!: true

# Ensure tool output exists
get_weather:
  output:
    not_null!: true

# Ensure specific field exists
search_results:
  output:
    items:
      not_null!: true
Use not_null!: true as a first validator to ensure the target exists before applying other validators.

type!

Checks that a value is of a specific type.
output:
  type!: "string"
ParameterTypeDescription
valuestringType name

Supported Types

TypeMatches
stringStrings
intIntegers
floatFloating-point numbers
numberAny numeric type
boolBoolean values
arrayLists/arrays
objectDictionaries/objects
nullNone/null values
# String output
output:
  type!: "string"

# Numeric result
calculate:
  output:
    type!: "number"

# Array of results
search_products:
  output:
    type!: "array"

# Object response
get_user:
  output:
    type!: "object"

# Boolean flag
validate:
  output:
    type!: "bool"

not_type!

Checks that a value is NOT of a specific type. This is the negated form of type!.
output:
  not_type!: "null"
ParameterTypeDescription
valuestringType name that must NOT match
# Ensure output is not null
output:
  not_type!: "null"

# Ensure result is not a string (expect structured data)
process_data:
  output:
    not_type!: "string"

# Ensure not returning an error object
validate:
  output:
    not_type!: "object"

json!

Checks that a string value is valid JSON.
output:
  json!: true
ParameterTypeDescription
valuebooleantrue to require valid JSON
# Ensure output is valid JSON
output:
  json!: true

# Combine with content checks
output:
  json!: true
  contains!: '"status"'
  contains!: '"success"'
The json! validator only checks that the string is valid JSON. It does not validate the JSON structure. Use contains! or pattern! for content checks.

email!

Checks that a string value is a valid email format.
extract_email:
  output:
    email!: true
ParameterTypeDescription
valuebooleantrue to require valid email format
# Validate extracted email
extract_contact:
  output:
    email:
      email!: true

Common Patterns

Structured Output Validation

output:
  not_null!: true
  type!: "string"
  json!: true
  contains!: '"id"'
  contains!: '"status"'

Type-Safe Numeric Results

calculate:
  output:
    type!: "number"
    gte!: 0
    lte!: 100

Span Output Type Checking

get_datetime:
  output:
    type!: "string"
    pattern!: "^\\d{4}-\\d{2}-\\d{2}"

search_products:
  output:
    type!: "array"
    min_length!: 1

Validating Nested Fields

get_user:
  output:
    type!: "object"
    
# Or validate specific nested fields
get_user:
  output:
    profile:
      name:
        type!: "string"
        not_null!: true
      email:
        email!: true