tealflow_discover_datasets
Discover ADaM datasets in a directory by scanning files, extracting dataset names, and collecting metadata (size, format, standard vs custom). Requires an absolute directory path.
Instructions
Discover ADaM datasets in a directory.
This tool scans a directory for ADaM dataset files, identifies the dataset names, and collects metadata about each dataset. It handles complex filenames with project names, dates, and drug names, and normalizes dataset names to uppercase.
IMPORTANT: This tool requires an absolute path to the dataset directory. Relative paths will not work correctly due to MCP server/client working directory differences.
Args: data_directory (str): Absolute path to the directory containing dataset files. Example: '/home/user/project/data/' or 'C:\Users\user\project\data'. file_formats (list[str], optional): List of file formats to include (e.g., ['Rds', 'csv']). If None, all supported formats are included. Defaults to None. pattern (str, optional): File pattern to match (default: 'AD*' for ADaM datasets). Defaults to 'AD*'. response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: Discovery results with information about found datasets
Includes:
- List of discovered datasets with names, paths, and formats
- Dataset metadata (size, readability, standard vs custom)
- Summary statistics
- Warnings about any issuesExamples: - Discover datasets with absolute path: data_directory="/home/user/project/workspace/" - Discover with specific format: data_directory="/home/user/data/", file_formats=["Rds"] - Get JSON format: data_directory="/home/user/data/", response_format="json"
Common Errors: - FileNotFoundError: Directory not found. Ensure you provide the full absolute path. - Relative paths like "data/" or "workspace/" will not work - use absolute paths.
Note: This tool extracts ADaM dataset names from filenames, handling: - Complex filenames (e.g., "project123_ADSL_2024-01-15.Rds" → "ADSL") - Case variations (e.g., "adsl.Rds", "AdTtE.csv" → "ADSL", "ADTTE") - Multiple formats (.Rds, .csv, case-insensitive extensions)
For best results, always ask the user for the complete absolute path to their dataset directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | No | AD* | |
| file_formats | No | ||
| data_directory | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |