Function Schemas
Adding validation constraints to parameters
Your Progress
0 / 5 completedValidation Rules
Validation rules ensure agents provide correct data. They catch errors before execution and guide agents toward valid inputs.
๐งชInteractive Validation Tester
Select a rule and test different inputs
๐ minLength
Minimum string length
{ "type": "string", "minLength": 3 }๐งช Test Input:
โ
Valid
Input passes validation
โ Pass Example:
"Hello"โ Fail Example:
"Hi"๐ Common Validation Rules
String Rules:
โข minLength / maxLength
โข pattern (regex)
โข format (email, url, date)
โข enum (fixed choices)
Number Rules:
โข minimum / maximum
โข exclusiveMinimum / exclusiveMaximum
โข multipleOf
Array Rules:
โข minItems / maxItems
โข uniqueItems
โข items (type of elements)
Object Rules:
โข required (mandatory fields)
โข properties (field definitions)
โข additionalProperties
โ Validation Best Practices
โ
Be specific: Add constraints that match your business logic
โ
Provide defaults: Use "default" property for optional parameters
โ
Use enums: Limit choices when values are fixed
โ
Format hints: Use "format" for dates, emails, URLs
โ
Test thoroughly: Verify edge cases and boundary values