Expand description
Dry-run file inspection for the inspect_file MCP tool.
Given a path to a CSV, Parquet, or Arrow IPC file, inspect_source
returns the schema we would use to create a table (using the exact same
inference + full-file numeric widening as crate::ingest) along with
per-column diagnostics that help an LLM pick a safer schema override
before running load_file:
null_count— how many null / empty cells were seen in the full file.min/max— smallest and largest values observed for numeric columns.sample_values— a handful of raw string values from the first rows.
Nothing is written to Hyper; the engine is not even touched. The result is
intentionally cheap enough to call eagerly before every load_file, which
is the workflow we recommend in the tool description and error suggestions.
For non-CSV inputs we fall back to the file’s embedded schema (Parquet / Arrow IPC carry exact types) and skip min/max because extracting those cheaply would mean decoding every batch.
Structs§
- Column
Stats - Per-column diagnostics returned alongside the inferred schema.
- Inspect
Report - Full inspection result for a single source.
Constants§
- DEFAULT_
SAMPLE_ ROWS - Default number of sample rows returned for each column if the caller does not request a specific count. Small enough to keep the response compact for LLM clients while still giving a human-readable preview.
Functions§
- inspect_
json_ from_ text - Inspect a JSON / JSONL text string (already in memory) without
reading from a file. Used by the
inspect_filehandler whenjson_extract_pathhas already extracted the relevant slice. - inspect_
source - Top-level dispatcher: pick the right inspector for
pathusing the same extension + content-sniffing logiccrate::ingest::detect_file_formatdrives for the ingest side. That shared dispatcher is what ensuresinspect_fileandload_filecan never disagree on what a file is — if inspect says “this is JSONL”, load will try it as JSONL too.