tealflow_get_dataset_info
Inspect dataset files to reveal columns, data types, row counts, and sample values without loading full data. Ideal for verifying structure and compatibility before building Teal applications.
Instructions
Get detailed information about a dataset file including columns, types, and row count.
This tool reads a dataset file (.rds or .csv) and returns comprehensive metadata about its structure without loading the entire dataset into memory. It's useful for understanding the contents of a dataset before using it in a Teal application.
IMPORTANT: This tool requires an absolute path to the dataset file. Relative paths will not work correctly due to MCP server/client working directory differences.
Args: file_path (str): Absolute path to the dataset file (.rds or .csv). Example: '/home/user/data/ADSL.Rds' or 'C:\Users\user\data\ADSL.csv'. include_sample_values (bool, optional): Whether to include sample values (first 5 unique values) for each column. Useful for understanding data content. Defaults to True. response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: Dataset information with columns, types, and metadata
Markdown format includes:
- File path and basic statistics (rows, columns, file size)
- Table of columns with names and types
- If include_sample_values=True: Detailed view with sample values for each column
JSON format includes:
- file_path: Path to the dataset
- row_count: Number of rows
- column_count: Number of columns
- file_size_bytes: File size in bytes
- columns: Array of column objects with name, type, and optional sample_valuesColumn Type Mapping: - For RDS files: R types (integer, numeric, character, logical, category, POSIXct) - For CSV files: Pandas-derived types (integer, numeric, character, logical, datetime) - category: R factors or categorical data - character: String/text data - integer: Whole numbers - numeric: Decimal numbers - logical: Boolean values - POSIXct/datetime: Date and time values
Examples: - Get basic info: file_path="/home/user/data/ADSL.Rds" - Get with samples: file_path="/home/user/data/ADSL.Rds", include_sample_values=True - Get JSON format: file_path="/home/user/data/ADSL.csv", response_format="json"
Common Errors: - FileNotFoundError: File not found at the specified path - ValueError: Unsupported file format (only .rds and .csv are supported) - ValueError: Invalid or corrupted dataset file
Use Cases: - Verify dataset structure before creating Teal app - Understand available columns for module configuration - Check data types to ensure compatibility with module requirements - Inspect sample values to understand data content - Validate dataset after loading from external sources
Note: This tool reads only the dataset structure, not the full data, making it efficient even for large datasets. For RDS files, it uses pyreadr. For CSV files, it uses pandas.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| response_format | No | markdown | |
| include_sample_values | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |