CSV Schema Validator
schema.validate_csv_schema
Overview
You send CSV data together with a list of the columns you expect, and we tell you where the file disagrees: a required column that is not there, an empty cell in a column you said cannot be empty, and any value that does not parse as the type you declared. Every problem comes back with its row number, its column name, a stable code, and a readable message, so you can act on it or show it to whoever sent you the file. We check names, emptiness, and types — not ranges, patterns, or allowed-value lists. Accepts file input via file_ref — no need to extract file content first.
CSV is still how most data changes hands, and a single mistyped cell can poison an import hours after it started. Catching it at the door, with the row and column named, is cheaper than unwinding it later.
Reliability
Deterministic: the same file, schema, and options always produce the same errors in the same order. Type checks are deliberately simple — a whole number for integer, any parseable number for number, true, false, 0 or 1 for boolean, YYYY-MM-DD for date, and a date followed by a time for datetime — and a type name we do not recognise passes everything. Empty cells are skipped by the type check, so nullable is what enforces presence. If the text cannot be parsed as CSV at all we return the recoverable failure CSV_MALFORMED, which you can clear by inspecting the real structure with schema.infer_csv_schema and calling again with the right delimiter. We reject the call, and an unchanged retry will not help, when neither csv nor file_ref is present, when schema is missing or has no non-empty columns array, when the text exceeds 10485760 bytes, or when a referenced file is missing, unreadable, or over 5000000 bytes.
Context footprint
Inline text is capped at 2097152 characters and a referenced file at 5000000 bytes; the response holds at most maxErrors short rows, so a badly broken file does not flood your context. A successful call costs 1 execution credit.
When to use it
Right before CSV data enters your system, especially when it came from somewhere you do not control. If you do not know the columns yet, run schema.infer_csv_schema first and validate against what it found.
When you have no expectations to check against yet, or when what you really want is for the data to be cleaned up rather than judged.
Powered by Apache Commons CSV, a hardened RFC 4180 parser relied on across the Java ecosystem for robust CSV handling.
Scope
Non-goals
- We never work out the columns for you — that is schema.infer_csv_schema
- We never clean, coerce, or reshape the data — that is data.csv_normalize
- We never check ranges, patterns, or allowed-value lists, only names, emptiness, and types
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 4.8 MiB | Skill maximum |
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify using a self-contained open-source component
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Self contained open source component
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| csv | string | No | CSV text, 1 to 2097152 characters. Required unless file_ref is provided. |
| file_ref | string | No | Tenant-owned CSV file reference; omit it to read csv. When both are sent this one wins. |
| schema | object | Yes | Closed CSV schema with a non-empty columns array; unlisted file columns are ignored. |
| delimiter | string | No | Field delimiter, a single character; omit it for comma. |
| quoteChar | string | No | Quote character, a single character; omit it for double-quote. |
| header | boolean | No | Whether the first row is a header; omit it for true. |
| maxErrors | integer | No | How many problems to list; omit it for the skill default. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | True when every checked cell satisfied the schema. |
| rowCount | integer | Yes | How many data rows were checked. |
| columnCount | integer | Yes | How many columns the header named. |
| errorCount | integer | Yes | How many problems are in the errors list. |
| errors | array | Yes | Problems in file order, 0 through 100000 closed {row, column, code, message} objects. |
| warnings | array | Yes | Non-fatal advisory notices as 0 through 256 strings, each one sentence long; empty when nothing was worth flagging. |
| truncated | boolean | No | True when more problems existed than maxErrors; omit it when the list is complete. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"schema.validate_csv_schema","input":{"csv":"name,age\nAlice,30","schema":{"columns":[{"name":"name","type":"string","required":true},{"name":"age","type":"integer","required":true}]}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("schema.validate_csv_schema", {"csv":"name,age,email\nAlice,30,[email protected]\nBob,25,[email protected]","schema":{"columns":[{"name":"name","required":true,"type":"string"},{"name":"age","required":true,"type":"integer"},{"name":"email","required":true,"type":"string"}]}});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| CSV_MALFORMED | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- We never work out the columns for you — that is schema.infer_csv_schema
- We never clean, coerce, or reshape the data — that is data.csv_normalize
- We never check ranges, patterns, or allowed-value lists, only names, emptiness, and types
- Discovering what the columns are in the first place (schema.infer_csv_schema)
- Cleaning or converting the data (data.csv_normalize)
- Checking JSON or XML rather than tabular data
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "schema.validate_csv_schema",
"input": {
"csv": "name,age,email\nAlice,30,[email protected]\nBob,25,[email protected]",
"schema": {
"columns": [
{
"name": "name",
"required": true,
"type": "string"
},
{
"name": "age",
"required": true,
"type": "integer"
},
{
"name": "email",
"required": true,
"type": "string"
}
]
}
}
}Examples
Valid CSV against schema
{
"csv": "name,age,email\nAlice,30,[email protected]\nBob,25,[email protected]",
"schema": {
"columns": [
{
"name": "name",
"required": true,
"type": "string"
},
{
"name": "age",
"required": true,
"type": "integer"
},
{
"name": "email",
"required": true,
"type": "string"
}
]
}
}{
"rowCount": 2,
"errorCount": 0,
"valid": true,
"errors": [],
"warnings": [],
"columnCount": 3
}Invalid CSV with type mismatch
{
"csv": "name,age,email\nAlice,thirty,[email protected]",
"schema": {
"columns": [
{
"name": "name",
"required": true,
"type": "string"
},
{
"name": "age",
"required": true,
"type": "integer"
},
{
"name": "email",
"required": true,
"type": "string"
}
]
}
}{
"rowCount": 1,
"errorCount": 1,
"valid": false,
"errors": [
{
"code": "type_mismatch",
"column": "age",
"message": "Expected integer, got 'thirty'",
"row": 1
}
],
"warnings": [],
"columnCount": 3
}Recommended use cases
- Check an uploaded file before you let it near your database
- Guard a scheduled import so a bad export fails loudly instead of quietly
- Tell a partner exactly which rows and columns of their file are wrong
Avoid for
- Discovering what the columns are in the first place (schema.infer_csv_schema)
- Cleaning or converting the data (data.csv_normalize)
- Checking JSON or XML rather than tabular data
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.