xano_validate_xanoscript
Validate XanoScript code for syntax errors using code strings, file paths, or directories. Get detailed error reports with line numbers and fix suggestions.
Instructions
Validate XanoScript code for syntax errors. Supports multiple input methods:
code: Raw XanoScript code as a string
file_path: Path to a single .xs file (easier than escaping code!)
file_paths: Array of file paths for batch validation
directory: Validate all .xs files in a directory
Returns errors with line/column positions and helpful suggestions for common mistakes. The language server auto-detects the object type from the code syntax.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The XanoScript code to validate as a string. Use file_path instead if the code contains special characters that are hard to escape. Example: "var $name:text = 'hello'\nreturn $name" | |
| file_path | No | Path to a single XanoScript file to validate. Easier than passing code directly - avoids escaping issues. Example: "function/format.xs" | |
| file_paths | No | Array of file paths for batch validation. Returns a summary with per-file results. Example: ["api/users/get.xs", "api/users/create.xs", "function/format.xs"] | |
| directory | No | Directory path to validate. Validates all .xs files recursively. Use with 'pattern' to filter specific subdirectories or files. Example: "api/users" | |
| pattern | No | Glob pattern to filter files when using 'directory' (default: "**/*.xs"). Examples: "api/**/*.xs" to match only API files, "**/create.xs" to match all create files. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | Whether the code passed validation without errors. | |
| message | Yes | Human-readable validation summary with error details if any. | |
| warnings | No | Number of non-fatal warnings encountered, if any. |