MCP Tools
ochreml_dataset_profile
Profile a CSV, TSV, or Parquet dataset for shape, column dtypes, missingness, summary stats, and target task inference.
ochreml_dataset_profile inspects a tabular dataset inside the allowed MCP root and returns column-level statistics without requiring pandas or numpy. CSV and TSV files are parsed with Python's stdlib csv module; Parquet files (.parquet / .pq) are read automatically if optional pyarrow, polars, or pandas is installed.
It is backed by ochreml._ops.op_dataset_profile().
Input Schema
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | — | Path to CSV, TSV, or Parquet file (contained within MCP root). |
target | string | No | null | Optional target column name for task inference and distribution summary. |
max_rows | integer | No | null | Optional maximum number of rows to scan (sets truncated: true if hit). |
Guardrails
pathis validated byOchreMCPServer._resolve_contained(path). Any traversal outside--root/OCHREML_MCP_ROOTreturnsisError: true.- Missing tokens recognized case-insensitively:
"","na","n/a","nan","null","none","inf","-inf".
Example JSON-RPC Call
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "ochreml_dataset_profile",
"arguments": {
"path": "data/housing.csv",
"target": "price",
"max_rows": 5000
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
path | string | Resolved dataset path. |
format | string | Detected format: "csv", "tsv", or "parquet". |
size_bytes | integer | File size in bytes. |
n_rows | integer | Number of rows scanned. |
n_cols | integer | Number of columns. |
truncated | boolean | true if max_rows capped the scan. |
columns | object[] | Per-column profiles: name, dtype ("numeric", "categorical", or "empty"), missing_count, missing_pct, n_unique, plus min/max/mean/std (numeric) or top_values top-5 map (categorical). |
target_summary | object | Included when target is specified: column, inferred_task ("classification" or "regression"), dtype, missing_count, n_unique, and either class_distribution (top 20 classes) or min/max/mean/std. |
Example Response Payload
{
"path": "/workspace/data/housing.csv",
"format": "csv",
"size_bytes": 184320,
"n_rows": 5000,
"n_cols": 4,
"truncated": true,
"columns": [
{
"name": "sqft",
"missing_count": 0,
"missing_pct": 0.0,
"n_unique": 1420,
"dtype": "numeric",
"min": 450.0,
"max": 6800.0,
"mean": 1982.4,
"std": 612.15
}
],
"target_summary": {
"column": "price",
"inferred_task": "regression",
"dtype": "numeric",
"missing_count": 0,
"n_unique": 3890,
"min": 85000.0,
"max": 1950000.0,
"mean": 412500.0,
"std": 185200.5
}
}