constraint_validate
Validate values against LMQL-style constraints like YQ_PATH, JSON_VALUE, or INT to ensure data integrity before processing in JSON/YAML/TOML operations.
Instructions
Validate a value against an LMQL-style constraint.
Use this tool to check if a value satisfies a constraint before using it in other operations. Supports partial validation - can tell if an incomplete input could still become valid.
Output contract: Returns {"valid": bool, "error": str?, "is_partial": bool?, ...}. Side effects: None (read-only validation). Failure modes: ToolError if constraint name unknown.
Available constraints:
YQ_PATH: Valid yq path (e.g., '.users[0].name')
YQ_EXPRESSION: Valid yq expression with pipes (e.g., '.items | length')
CONFIG_FORMAT: Valid format ('json', 'yaml', 'toml', 'xml')
KEY_PATH: Dot-separated key path (e.g., 'config.database.host')
INT: Valid integer
JSON_VALUE: Valid JSON syntax
FILE_PATH: Valid file path syntax
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| constraint_name | Yes | Name of the constraint to validate against (e.g., 'YQ_PATH', 'CONFIG_FORMAT', 'INT') | |
| value | Yes | Value to validate |