TealFlowMCP
OfficialClick on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TealFlowMCPcreate a Teal app for ADSL dataset with demographics module"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TealFlowMCP
An MCP (Model Context Protocol) server that enables LLMs to discover, understand, and generate Teal R Shiny applications for clinical trial data analysis.
Currently supports two Teal module packages:
teal.modules.general - General-purpose analysis modules
teal.modules.clinical - Clinical trial-specific modules
Documentation
Quickstart Guide - Get started with VSCode and GitHub Copilot
Tool Reference - Complete reference for all 14 MCP tools
Configuration Guide - Setup, usage examples, and FAQs
Related MCP server: OMOP MCP Server
Quick Start
New to TealFlowMCP? Check out the Quickstart Guide for step-by-step instructions to get up and running with VSCode and GitHub Copilot.
Prerequisites
Python 3.10+
R (required for running generated Teal applications)
For development/source installation only:
uv (Python project manager) - Installation guide
MCP Compatibility
This server implements the Model Context Protocol (MCP) standard and works with any MCP-compatible LLM client, including:
Claude Code
GitHub Copilot
Cursor
Other MCP-compatible tools that support the MCP stdio protocol
The server is LLM-agnostic—it provides tools that any LLM can use to build Teal applications.
Adding to Your Editor/IDE
For PyPI installation:
{
"tealflow-mcp": {
"command": "tealflow-mcp"
}
}For source installation:
{
"tealflow-mcp": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/TealFlowMCP", "run", "tealflow_mcp.py"]
}
}Replace /absolute/path/to/TealFlowMCP with the actual absolute path to your cloned repository.
Consult your editor's documentation for the exact location of the MCP configuration file. See the Quickstart Guide and Configuration Guide for detailed setup instructions.
Architecture
The MCP server is organized as a modular Python package for maintainability and extensibility:
TealFlowMCP/
├── tealflow_mcp.py # Backward-compatibility wrapper
├── tealflow_mcp/ # Main package
│ ├── core/ # Constants and enums
│ ├── data/ # Data loaders
│ ├── knowledge_base/ # Metadata and templates
│ ├── models/ # Pydantic input models
│ ├── server.py # MCP server implementation
│ ├── tools/ # MCP tool implementations
│ └── utils/ # Utilities and formatters
├── docs/ # Documentation
├── tests/ # Automated tests
├── sample_data/ # Sample ADaM datasets
├── .github/ # CI/CD workflows
├── pyproject.toml # Project metadata & dependencies
├── uv.lock # Lockfile for exact versions
└── README.mdInstallation
Option 1: Install from PyPI (Recommended)
pip install tealflow-mcpOption 2: Install from Source (Development)
Clone the repository and install dependencies:
git clone https://github.com/Appsilon/TealFlowMCP.git
cd TealFlowMCP
uv syncVerify Installation
For pip installation, verify the package is installed:
python -c "import tealflow_mcp; print(f'TealFlowMCP version {tealflow_mcp.__version__}')"For source installation, run the test suite:
uv run python -m pytest tests/test_mcp_server.py -vTesting
Run All Tests
Run the complete test suite:
uv run python -m pytest tests/ -vRun Specific Test Files
# Test MCP server functionality
uv run python -m pytest tests/test_mcp_server.py -v
# Test dataset discovery
uv run python -m pytest tests/test_discovery.py -v
# Test ADaM name extraction
uv run python -m pytest tests/test_extract_adam_name.py -vRun Single Test
uv run python -m pytest tests/test_discovery.py::TestDatasetDiscovery::test_discover_rds_files -vRun with Coverage
uv run python -m pytest tests/ --cov=tealflow_mcp --cov-report=term-missing -vCode Quality
Check Linting
Check for linting issues:
uv run ruff check tealflow_mcp/ tests/Auto-fix Linting Issues
Automatically fix linting issues:
uv run ruff check tealflow_mcp/ tests/ --fixFormat Code
Format code consistently:
uv run ruff format tealflow_mcp/ tests/Type Checking
Run static type checking:
uv run mypy tealflow_mcp/Run All Checks
Run all code quality checks at once (same as CI):
uv run ruff check tealflow_mcp/ tests/ && \
uv run ruff format tealflow_mcp/ tests/ --check && \
uv run mypy tealflow_mcp/ && \
uv run python -m pytest tests/ -vContinuous Integration
This project uses GitHub Actions for automated testing and code quality checks.
The CI pipeline runs on every push and pull request:
✅ Linting and formatting checks
✅ Type checking with mypy
✅ Tests on Python 3.10, 3.11, and 3.12
✅ Code coverage reporting
Manual Testing
For quick manual verification:
# Test MCP server manually
uv run python tests/test_mcp_server.py
# Test discovery tool with sample data
uv run python -c "
from tealflow_mcp.tools.discovery import discover_datasets
import os
result = discover_datasets(os.path.abspath('sample_data'))
print(f'Found {result[\"count\"]} datasets')
"Running the MCP
For PyPI installation:
tealflow-mcpFor source installation:
uv --directory /absolute/path/to/TealFlowMCP/ run tealflow_mcp.pyYou can also test the MCP using the MCP inspector:
PyPI installation:
npx @modelcontextprotocol/inspector tealflow-mcpSource installation:
npx @modelcontextprotocol/inspector uv --directory /absolute/path/to/TealFlowMCP/ run tealflow_mcp.pyAvailable Tools
TealFlowMCP provides 14 tools for building Teal applications:
Agent Guidance:
tealflow_agent_guidance- START HERE - Get comprehensive development guidance and learn how to use all other tools
Module Discovery & Search:
tealflow_list_modules- List all available Teal modulestealflow_search_modules_by_analysis- Find modules by analysis typetealflow_get_module_details- Get detailed module information
Code Generation:
tealflow_generate_module_code- Generate R code for modulestealflow_get_app_template- Get base Teal app templatetealflow_generate_data_loading- Generate R script for loading datasets
Dataset Management:
tealflow_list_datasets- List available clinical trial datasetstealflow_discover_datasets- Scan directories for ADaM datasetstealflow_check_dataset_requirements- Check dataset compatibilitytealflow_get_dataset_info- Get information about ADaM datasets
Environment & Validation:
tealflow_setup_renv_environment- Initialize R environment with renvtealflow_snapshot_renv_environment- Snapshot current R environment statetealflow_check_shiny_startup- Validate app startup
View complete tool reference →
Configuration
TealFlowMCP works with any MCP-compatible client (Claude Desktop, Claude Code, GitHub Copilot, Cursor, etc.).
Basic Configuration:
{
"servers": {
"tealflow-mcp": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/TealFlowMCP",
"run",
"tealflow_mcp.py"
]
}
}
}View complete configuration guide →
Quick Start
Once configured, you can use natural language to build Teal apps:
Example:
I have ADSL and ADTTE datasets. Build me a Teal app with Kaplan-Meier plots and Cox regression.
The LLM will automatically:
Setup the R environment
Search for relevant modules
Validate dataset compatibility
Generate complete app code
View usage examples and FAQs →
Contributing
We welcome contributions to TealFlowMCP! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
Please see the Contributing Guide for detailed guidelines on our development workflow, branching strategy, and version management.
About Appsilon
TealFlowMCP is developed by Appsilon, a trusted technology partner for pharmaceutical and life sciences companies specializing in accelerating drug development through open-source solutions. Appsilon helps organizations transition from legacy systems to modern, validated open-source analytics while maintaining strict regulatory compliance.
Learn more at appsilon.com
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.
Available Tools
14 toolstealflow_agent_guidanceARead-onlyIdempotent
Get comprehensive guidance for assisting users with Teal application development.
⚠️ IMPORTANT: This tool MUST be called FIRST whenever a user requests:
Creating a Teal application or Teal app
Adding Teal modules to an app
Building clinical trial analysis applications
Survival analysis, safety analysis, efficacy analysis, or any clinical data analysis
Working with Statistical Analysis Plans (SAP)
Understanding Teal modules or datasets
Any other Teal-related task
This tool provides the complete agent usage guide that includes:
Your role and responsibilities as a Teal assistant
Available MCP tools and when to use them
Step-by-step workflow guidance for common scenarios
Teal framework knowledge (modules, datasets, architecture)
Important module constraints and special cases
Development philosophy and R code style guidelines
Best practices for agent behavior
Example workflows for common tasks
The guidance ensures you:
Follow correct workflows for creating and modifying Teal apps
Use the right MCP tools in the right sequence
Verify dataset compatibility before suggesting modules
Generate properly structured R code
Provide complete, working solutions
Handle multi-step tasks with proper planning
Usage: Always retrieve this guidance at the start of any Teal-related conversation to ensure you have the latest best practices, workflows, and constraints.
Returns: str: Complete agent guidance document in markdown format with all necessary context, workflows, and best practices for assisting with Teal development.
Examples: User: "I need to create a survival analysis app" → First action: Call this tool to get guidance → Then follow the workflow in the guidance to assist the user
User: "Add a Kaplan-Meier module to my app"
→ First action: Call this tool to get guidance
→ Then use the appropriate MCP tools as directed in the guidance
User: "Help me implement analyses from my SAP"
→ First action: Call this tool to get guidance
→ Then follow the SAP workflow described in the guidance
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations (readOnlyHint, idempotentHint, etc.), the description explains what the tool returns (a complete markdown guidance document) and its role in ensuring correct workflows, tool sequencing, dataset compatibility checks, and code generation. This adds substantial behavioral context without contradicting annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is lengthy but well-structured with clear sections, bullet points, and examples. It is front-loaded with the critical 'IMPORTANT' notice. Some redundancy exists (e.g., repeated emphasis on calling first across multiple sections), but each part adds value for such an important prerequisite tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description fully covers the tool's role, triggers, expected content, return type, and example workflows. Given the output schema exists and the tool has no parameters, this description provides all necessary context for an agent to use it correctly as the initial step in Teal-related interactions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has no parameters, so the baseline is 4. The description correctly omits parameter details and instead focuses on the tool's output and usage, which is appropriate for a zero-parameter meta-guidance tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get comprehensive guidance for assisting users with Teal application development.' It uses a specific verb and resource, and distinguishes itself from sibling tools by positioning itself as the mandatory first step for any Teal-related task.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says when to use the tool ('MUST be called FIRST whenever...') with a detailed list of triggering scenarios, and provides example user requests with corresponding first actions. It also instructs 'Always retrieve this guidance at the start of any Teal-related conversation', making usage guidance unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_check_dataset_requirementsARead-onlyIdempotent
Check if required datasets are available for a specific module.
This tool validates whether you have all necessary datasets before attempting to use a module. It compares the module's dataset requirements against your available datasets and provides clear feedback. Supports flexible dataset types that match multiple dataset names.
IMPORTANT: Before checking compatibility, use tealflow_get_dataset_info to verify that your datasets have the correct structure and data types for the module:
For BDS_CONTINUOUS modules (ANCOVA, MMRM): Verify AVAL is continuous numeric
For BDS_BINARY modules (logistic GEE): Verify AVAL is binary 0/1
For all BDS modules: Verify required columns exist (PARAMCD, AVISIT, USUBJID, etc.)
Args: module_name (str, required): Name of the module to check dataset requirements for. available_datasets (list[str], required): List of available dataset names (e.g., ['ADSL', 'ADLB', 'ADVS']). response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: Compatibility report with status and missing/matched datasets
Includes:
- Compatibility status (compatible/incompatible)
- List of required datasets (with flexible types if applicable)
- Matched datasets (which available datasets satisfy flexible requirements)
- Typical datasets (examples for flexible types)
- Dataset requirements (detailed descriptions)
- Notes (special considerations)
- List of missing datasets (if any)
- Suggestions for alternatives and guidanceFlexible Dataset Type Matching: - BDS_DATASET: Matches ADLB, ADVS, ADQS, ADEG, ADEX (any BDS structure) - BDS_CONTINUOUS: Matches ADLB, ADVS, ADQS (BDS with continuous data) - BDS_BINARY: Matches ADRS (BDS with binary outcomes) - Specific names: Must match exactly (ADSL matches ADSL, ADTTE matches ADTTE)
Examples: - Check KM plot (specific dataset): module_name="tm_g_km", available_datasets=["ADSL", "ADTTE"] - Check ANCOVA (flexible BDS_CONTINUOUS): module_name="tm_t_ancova", available_datasets=["ADSL", "ADLB"] - Check with custom datasets: module_name="tm_g_km", available_datasets=["ADSL", "ADTTE", "ADLB"]
Recommended Workflow: 1. Call tealflow_discover_datasets to find available datasets 2. Call tealflow_get_dataset_info to verify structure and data types 3. Call this tool to check compatibility 4. If compatible and data types verified, proceed with module generation
| Name | Required | Description | Default |
|---|---|---|---|
| module_name | Yes | ||
| response_format | No | markdown | |
| available_datasets | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds behavior beyond annotations by detailing what the tool does (compares requirements, returns compatibility report) and how it handles flexible dataset types. It does not contradict annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is lengthy but well-structured with clear sections (Args, Returns, Flexible Dataset Type Matching, Examples, Recommended Workflow). It front-loads the core purpose and then provides necessary detail. Some redundancy exists (e.g., repeated mention of verification), but overall every section serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity and schema with 0% property descriptions, the description delivers complete context: parameter details, return content, flexible matching rules, examples, and a recommended workflow. The presence of an output schema reduces the need to explain return format, but the description still covers it, ensuring the agent can use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema coverage is 0%, so the description fully compensates. It explicitly explains module_name, available_datasets with an example list, and response_format with allowed values and default. Examples further illustrate parameter usage, making parameter semantics crystal clear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb+resource: 'Check if required datasets are available for a specific module.' It distinguishes itself from sibling tools by focusing on validating module requirements rather than listing or discovering datasets. The first sentence alone captures the purpose unambiguously.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit workflow guidance: 'Recommended Workflow' includes steps to call discover_datasets, get_dataset_info, then this tool. It also advises using get_dataset_info before checking compatibility, clarifying the proper sequence and relationship to alternatives. This is rare and valuable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_check_shiny_startupARead-onlyIdempotent
Check if a Shiny app starts without errors.
This tool runs the Shiny app file using shiny::runApp() to detect startup errors without keeping the app running or waiting for user interaction. It's useful for validating that a Teal application has been correctly configured before attempting to run it interactively.
Args: app_path (str, optional): Path to the Shiny app directory. Defaults to ".". app_filename (str, optional): Name of the app file to run (e.g., 'app.R', 'server.R'). Defaults to "app.R". timeout_seconds (int, optional): Maximum time in seconds to allow the app to start (1-120). Defaults to 15.
Returns: str: JSON object with startup validation results
Success response:
{
"status": "ok",
"error_type": null,
"message": "App started successfully",
"logs_excerpt": "... last 20 lines of output ..."
}
Error response:
{
"status": "error",
"error_type": "missing_package" | "syntax_error" | "object_not_found" |
"timeout" | "file_not_found" | "rscript_not_found" |
"connection_error" | "execution_error",
"message": "Detailed error description",
"logs_excerpt": "... last 30 lines of output ..."
}Error Types: - missing_package: Required R package is not installed - syntax_error: R syntax error in app.R - object_not_found: Referenced R object does not exist - timeout: App did not start within the specified timeout - file_not_found: app.R file not found at specified path - rscript_not_found: Rscript command not available (R not installed) - connection_error: Network or file connection error - execution_error: Other R execution error
Examples: - Check app in current directory: (no parameters needed) - Check app in specific directory: app_path="/path/to/app" - Check specific app file: app_filename="server.R" - Use longer timeout: timeout_seconds=30
Note: This tool does not launch an interactive Shiny session. It only validates that the app can start without immediate errors. The process is terminated once startup is confirmed or an error is detected.
| Name | Required | Description | Default |
|---|---|---|---|
| app_path | No | . | |
| app_filename | No | app.R | |
| timeout_seconds | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description adds substantial behavioral context beyond annotations: it runs the app using shiny::runApp(), detects startup errors only, terminates the process after confirmation or error, and details timeout behavior. None of this contradicts the readOnlyHint and idempotentHint annotations, and it meaningfully extends them.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (summary, Args, Returns, Error Types, Examples, Note) and front-loaded with the core purpose. Every section contributes valuable information—no redundant or filler content—making it appropriately detailed without being bloated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity, the description is remarkably complete. It includes parameter details, output JSON structure, a comprehensive list of error types, examples for typical use cases, and a note about non-interactive behavior. It fully equips an agent to invoke the tool correctly and interpret results, despite the presence of an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides only type and default, with 0% description coverage. The description compensates fully by explaining each parameter's meaning (e.g., app_path 'Path to the Shiny app directory', timeout_seconds 'Maximum time in seconds' with range 1-120) and offering concrete usage examples. This goes well beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description's first sentence 'Check if a Shiny app starts without errors' clearly identifies the action and resource. It further specifies the mechanism (shiny::runApp()) and differentiates from siblings by focusing on startup validation, a unique concern among the listed tealflow tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states it is 'useful for validating that a Teal application has been correctly configured before attempting to run it interactively,' providing clear context. It also notes the tool does not launch an interactive session and terminates after startup, but does not explicitly name alternative tools or exclusions, so it misses the top score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_discover_datasetsARead-onlyIdempotent
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.
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | No | AD* | |
| file_formats | No | ||
| data_directory | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only, idempotent, and non-destructive behavior. The description adds valuable operational context: absolute path requirement (and why relative paths fail), case-insensitive extension handling, normalization to uppercase, and common errors. It also explains the output contents, giving full transparency beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with sections (Args, Returns, Examples, Common Errors, Note) and front-loads the purpose. It is verbose, but every section adds necessary information given the 0% schema coverage. Some minor redundancy exists (e.g., filename handling is mentioned twice), so it loses one point.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 4 parameters, no schema descriptions, but rich annotations and an output schema, the description is complete. It covers purpose, input requirements, parameter semantics, examples, error conditions, filename edge cases, and return contents. There are no significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate fully. It does: data_directory is explained as an absolute path with examples, file_formats is defined as a list with null default, pattern is given its default 'AD*', and response_format is explained with 'markdown' vs 'json'. This adds rich meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Discover ADaM datasets in a directory,' a specific verb+resource+scope statement. It further explains that it scans, identifies dataset names, and collects metadata, clearly distinguishing it from sibling tools like list_datasets by emphasizing filename normalization and metadata collection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: it is used for discovering ADaM datasets, requires an absolute path, and handles complex filenames. It warns against relative paths and gives examples. However, it does not explicitly name alternative tools or state when to choose this tool over siblings, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_generate_data_loadingARead-onlyIdempotent
Generate R code for loading discovered datasets and creating a teal_data object.
This tool generates complete R code that loads ADaM datasets from files and creates a teal_data object with appropriate join keys. It's designed to work seamlessly with the output from tealflow_discover_datasets.
IMPORTANT: This tool requires the datasets list from tealflow_discover_datasets. Pass the 'datasets_found' array directly to this tool.
Path Handling: If datasets are in the project directory, provide project_directory to generate relative paths. Otherwise, absolute paths will be used.
Args: datasets (list[dict[str, Any]]): List of dataset dictionaries from discovery. Each dictionary must contain: - name: Dataset name (e.g., "ADSL") - path: Absolute path to dataset file - format: File format ("Rds" or "csv") - is_standard_adam: Whether it's a standard ADaM dataset project_directory (str, optional): Absolute path to the project directory. If provided, dataset paths within this directory will use relative paths. If None or datasets are outside, absolute paths will be used. Defaults to None. response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: Generated R code for loading datasets
Markdown format includes:
- Complete R code in code block
- Usage instructions
- List of datasets included
JSON format includes:
- code: The generated R code
- datasets: List of dataset names
- file_path: Recommended file path (data.R)
- instructions: Step-by-step usage instructionsGenerated Code Structure: 1. Library import (library(teal)) 2. Dataset loading (readRDS() for .Rds, read.csv() for .csv) 3. teal_data() object creation with all datasets 4. Join keys configuration: - For standard ADaM datasets: Uses default_cdisc_join_keys - For non-standard datasets: Includes warning comments
Workflow Integration: 1. Use tealflow_discover_datasets to find datasets 2. Pass the datasets_found array to this tool 3. Save the generated code as data.R in the project root 4. The app template will source this file
Examples: - Generate loading code: datasets=[...from discovery...] - Get JSON format: datasets=[...], response_format="json"
Note: - Datasets are sorted alphabetically for consistent output - Paths must be absolute (from discovery tool) - Currently supports Rds and csv formats - Extensible design for future format support
| Name | Required | Description | Default |
|---|---|---|---|
| datasets | Yes | ||
| response_format | No | markdown | |
| project_directory | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite strong annotations (readOnly, idempotent), the description adds substantial behavioral context: it clarifies the tool only generates code (it does not load data), mandates absolute paths, sorts datasets alphabetically, supports only Rds/csv formats, and details the generated code structure including join keys configuration. This goes well beyond what annotations convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with clear sections (IMPORTANT, Path Handling, Args, Returns, Generated Code Structure, Workflow Integration, Examples, Note). Every section serves a purpose, though some redundancy exists (e.g., path handling repeated). It remains appropriately sized for a complex code-generation tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the full invocation context: prerequisites, parameter semantics, return formats (markdown/json), generated code structure, and integration steps. With an output schema present, it doesn't need to detail every field, but it provides enough for correct selection and use. The sibling tool relationships are clarified via workflow.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, but the description fully compensates. It defines each parameter in detail: 'datasets' list contains name, path, format, is_standard_adam; 'project_directory' controls relative vs absolute paths; 'response_format' changes the return structure. This adds complete meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Generate R code for loading discovered datasets and creating a teal_data object.' This clearly distinguishes it from sibling tools like tealflow_generate_module_code, which focuses on module generation. The workflow integration section further clarifies its role in the discovery-to-app pipeline.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit workflow integration: use tealflow_discover_datasets first, pass the datasets_found array, save generated code as data.R. It also states that it is 'designed to work seamlessly' with discovery output. However, it does not explicitly name alternative tools or state when not to use this tool, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_generate_module_codeARead-onlyIdempotent
Generate R code for adding a module to a Teal application.
This tool generates ready-to-use R code for adding a Teal module to your app. It includes all required parameters with sensible defaults based on the module's specifications and Flow's available datasets.
IMPORTANT - Check data compatibility first: Before generating code, use tealflow_get_dataset_info to verify: - Required variables exist in datasets (ARM, PARAMCD, AVAL, etc.) - Data types match module requirements (binary vs continuous, numeric vs categorical) - Variable names match expected configuration (ACTARM vs ARM, AVISITN vs AVISIT) - Value ranges are appropriate for the module (0/1 binary vs continuous scale)
This prevents runtime errors and enables suggesting appropriate alternatives
when standard variables are missing or incompatible.Args: module_name (str, required): Name of the module to generate code for (e.g., 'tm_g_km', 'tm_t_coxreg', 'tm_g_scatterplot'). parameters (dict[str, Any], optional): Optional parameter overrides as JSON object. Defaults to None. (Not yet implemented) include_comments (bool, optional): Whether to include explanatory comments in the generated code. Defaults to True.
Returns: str: Complete R code snippet ready to paste into a Teal app
Includes:
- Module function call with proper syntax
- All required parameters
- Common optional parameters with defaults
- Explanatory comments (if requested)
- Usage instructionsExamples: - Generate KM plot code: module_name="tm_g_km" - Generate Cox regression code: module_name="tm_t_coxreg" - Generate without comments: module_name="tm_g_km", include_comments=False
Recommended workflow: 1. Use tealflow_get_dataset_info on relevant datasets 2. Verify variable availability and data types 3. Generate module code with this tool 4. Adjust configuration variables based on dataset inspection results 5. Validate with tealflow_check_shiny_startup
Note: Generated code uses Flow's standard dataset configuration. You may need to adjust parameters for your specific use case based on actual dataset structure discovered through tealflow_get_dataset_info.
| Name | Required | Description | Default |
|---|---|---|---|
| parameters | No | ||
| module_name | Yes | ||
| include_comments | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate read-only and idempotent behavior, but the description adds context: it returns a string snippet, includes comments conditionally, and discloses that the 'parameters' argument is 'Not yet implemented'. It also warns that generated code uses standard dataset configuration and may need adjustment, which is valuable behavioral info beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (IMPORTANT, Args, Returns, Examples, Recommended workflow, Note), but it has some redundancy. The first two sentences both state that it generates R code, and the 'Includes' list partly repeats the return details. It is longer than necessary but mostly earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is extremely complete for a code generation tool: it covers prerequisites, examples, input details, return value, workflow, and potential caveats. The presence of an output schema reduces the need to explain return values, but the description still provides sufficient context. No significant gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite the schema having 0% description coverage, the description fully compensates by explaining each parameter: module_name with examples, parameters as optional overrides with default None and note that it's not implemented, and include_comments with default True. It also describes the return value and includes, giving complete parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Generate R code for adding a module to a Teal application,' which is a specific verb+resource statement. It further clarifies by listing module examples (tm_g_km, tm_t_coxreg) and explaining it produces ready-to-use R code, clearly distinguishing it from sibling tools like data loading or app template generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides an explicit 'Recommended workflow' with 5 steps, instructing to use tealflow_get_dataset_info before generating code and tealflow_check_shiny_startup after. It also states to verify variable availability and data types, and notes when adjustments are needed. This gives clear when-to-use guidance and prerequisites, though it does not explicitly name alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_get_app_templateARead-onlyIdempotent
Get the Teal application template as a starting point for building apps.
This tool returns the base R code template that should be used to start any Teal app. The template includes data loading, configuration variables, and the basic structure for adding Teal modules.
Args: response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: Complete R code for the Teal app template
The template includes:
- Library imports (teal.modules.general, teal.modules.clinical)
- Data source loading (knowledge_base/data.R)
- Dataset configuration (ADSL, ADTTE, ADRS, ADQS, ADAE)
- Configuration variables (arm_vars, strata_vars, facet_vars, etc.)
- Helper variables (cs_arm_var, cs_strata_var, etc.)
- App initialization with basic modules (tm_front_page, tm_data_table, tm_variable_browser)Usage: 1. Get the template using this tool 2. Use tealflow_search_modules_by_analysis to find modules for your analysis 3. Use tealflow_generate_module_code to generate code for each module 4. Add generated modules to the modules() section (line 78) 5. Run the app
Examples: - Get template in markdown: response_format="markdown" - Get template as JSON: response_format="json"
Note: The template uses Flow's standard ADaM datasets (ADSL, ADTTE, ADRS, ADQS, ADAE). Modify the data source if using different datasets.
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare the tool as read-only and idempotent. The description adds context about the template's contents (library imports, dataset configuration, etc.) and a note on modifying data sources. However, there is a slight ambiguity around the return type when 'json' format is requested, as it says 'Returns: str' but could imply a structured object.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args, Returns, Usage, Examples, and Note sections. It is somewhat long due to the bullet list of template contents, but each item adds value for users understanding what the template includes. No redundant fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple getter tool, the description covers the purpose, what is returned, the template structure, usage workflow, examples, and important notes about data sources. The output schema exists, but the description goes beyond it by detailing the actual template components, making it fully complete for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides only a default with no description (0% coverage), but the description thoroughly explains the response_format parameter, including its two possible values ('markdown' and 'json') and defaults. Examples further clarify usage, fully compensating for the sparse schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets the Teal application template as a starting point for building apps. It specifies the exact resource and action, and the template contents are enumerated, making it distinct from sibling tools that focus on modules or datasets.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
An explicit 'Usage:' section provides step-by-step guidance, including using this tool first, then searching modules, generating code, and running the app. It clearly positions this tool as the initial step in a workflow, and examples illustrate parameter usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_get_dataset_infoARead-onlyIdempotent
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.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| response_format | No | markdown | |
| include_sample_values | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses critical behaviors: it requires an absolute path, reads only structure without loading the full dataset, uses pyreadr for RDS and pandas for CSV, and supports markdown or JSON response formats. It also lists common errors. This adds significant value beyond the annotations and is fully consistent with them.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with clear sections (IMPORTANT, Args, Returns, Column Type Mapping, Examples, Common Errors, Use Cases, Note). Each section adds useful information without redundancy. It is slightly verbose, but the structure helps an agent parse it efficiently, and every sentence serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete for a tool of this complexity: it covers parameters, return formats, type mappings, examples, errors, use cases, and performance characteristics. Given that an output schema exists, the detailed return format explanation is extra helpful. The description leaves no significant gaps for an agent to correctly select and invoke this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description carries the full burden for parameter explanations. It thoroughly explains file_path with absolute path requirement and examples, include_sample_values with its default and purpose, and response_format with 'markdown' vs 'json' options. It also includes examples of parameter combinations, fully compensating for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Get detailed information about a dataset file including columns, types, and row count.' It clearly focuses on inspecting a single dataset file, which distinguishes it from sibling tools like tealflow_list_datasets and tealflow_discover_datasets that handle dataset discovery and listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use the tool: 'useful for understanding the contents of a dataset before using it in a Teal application.' The 'Use Cases' section further elaborates on specific scenarios. It does not explicitly mention alternatives or when not to use it, but the differentiation from siblings and the practical use cases provide solid guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_get_module_detailsARead-onlyIdempotent
Get comprehensive details about a specific Teal module including all parameters and R help documentation.
This tool provides complete information about a module's required and optional parameters, their types, default values, descriptions, and official R help documentation. Use this after discovering a module to understand how to configure it properly.
Args: module_name (str, required): Name of the module (e.g., 'tm_g_km', 'tm_t_coxreg', 'tm_g_scatterplot'). response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: Detailed module information including parameters, datasets, R help, and usage
Includes:
- Module description
- Required datasets (may include flexible types: BDS_DATASET, BDS_CONTINUOUS, BDS_BINARY)
- Typical datasets (examples of datasets that satisfy flexible requirements)
- Dataset requirements (detailed descriptions of what each dataset needs)
- Notes (special considerations like regression type for tm_a_gee)
- Required parameters (no defaults)
- Optional parameters (with defaults)
- Parameter types and constraints
- R help documentation (complete help text from R's help system)
- Usage examples from R documentationFlexible Dataset Types: - BDS_DATASET: Any BDS-structured dataset (ADLB, ADVS, ADQS, ADEG, ADEX) - BDS_CONTINUOUS: BDS dataset with continuous AVAL (typically ADLB, ADVS, ADQS) - BDS_BINARY: BDS dataset with binary AVAL 0/1 (typically ADRS) - Specific names (ADSL, ADTTE, ADAE): Require exact dataset match
Error Handling: - Returns error if module not found - Suggests similar module names for typos - Provides guidance on correct module names - Falls back gracefully if R help is unavailable
Examples: - Get details for KM plot: module_name="tm_g_km" - Get Cox regression info: module_name="tm_t_coxreg" - Get ANCOVA details (shows BDS_CONTINUOUS): module_name="tm_t_ancova" - Get JSON format: response_format="json"
| Name | Required | Description | Default |
|---|---|---|---|
| module_name | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds extensive behavioral context beyond the annotations: error handling for missing modules, typo suggestions, graceful fallback for R help, and explanation of flexible dataset types. This complements the readOnly/idempotent hints without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-organized with sections for 'Includes', 'Flexible Dataset Types', 'Error Handling', and 'Examples'. Every section serves a purpose, though some redundancy exists (e.g., repeating parameters list).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (module details, dataset requirements, error handling, help docs), the description covers all key aspects: return content, dataset type explanations, error scenarios, and usage examples. It is self-sufficient for an agent to invoke correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by explaining module_name with concrete examples and response_format with values, defaults, and use cases. It adds meaning well beyond the bare schema definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves comprehensive details for a specific Teal module, including parameters and R help documentation. This distinguishes it from sibling tools like 'list_modules' or 'search_modules_by_analysis'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Use this after discovering a module to understand how to configure it properly', providing clear usage context. It doesn't name specific alternatives but the sibling tools and phrase 'after discovering' imply the appropriate workflow.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_list_datasetsARead-onlyIdempotent
List available clinical trial datasets in the project.
This tool provides information about the standard ADaM datasets available for use with Teal clinical modules. These datasets follow CDISC standards for clinical trial data.
Args: response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: List of datasets with descriptions and relationships
Includes:
- Dataset names (e.g., ADSL, ADTTE)
- Descriptions
- Usage information
- Relationship to other datasetsExamples: - List all datasets: (no parameters needed) - Get JSON format: response_format="json"
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, covering the safety profile. The description adds value by stating the output is a string with dataset names, descriptions, usage info, and relationships, plus the CDISC standards adherence. It also discloses that it lists 'standard ADaM datasets,' which is a scope limitation. This goes beyond the annotations without contradicting them.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args, Returns, Includes, and Examples sections. It is longer than necessary but each section earns its place by clarifying output and usage. The redundancy in the 'Includes' list (which largely mirrors Returns) is minor, but the format aids scanning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one optional parameter, no required inputs) and the presence of an output schema, the description covers the essential aspects: purpose, parameter, return format, and content. It lacks error scenarios or specifics about dataset relationships, but for a read-only list tool, this is adequate. The main gap is sibling differentiation, which is already penalized in usage_guidelines.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema for response_format is minimal (type and default), with 0% schema description coverage. The description fully compensates by explaining the parameter's purpose, valid values ('markdown' for human-readable, 'json' for machine-readable), and default behavior. This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'List available clinical trial datasets in the project.' It identifies a specific verb ('List'), a specific resource ('datasets'), and provides context (clinical trial, ADaM standards). This effectively distinguishes it from siblings like list_modules and get_module_details, which focus on modules rather than datasets.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides examples but lacks explicit guidance on when to use this tool versus alternatives. It does not mention sibling tools like tealflow_discover_datasets or tealflow_get_dataset_info, nor does it state when not to use this tool. Usage context is implied ('available for use with Teal clinical modules'), but there is no direct differentiation or exclusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_list_modulesARead-onlyIdempotent
List all available Teal modules with their descriptions and dataset requirements.
This tool helps discover what analysis modules are available in the Teal framework. Modules can be filtered by package (clinical vs general) and optionally by category.
Clinical modules are designed for clinical trial reporting and work with ADaM datasets. General modules are for general-purpose data exploration and work with any data.frame.
Args: package (str, optional): Filter by package - 'clinical', 'general', or 'all'. Defaults to 'all'. category (str, optional): Filter by category like 'graphics', 'tables', 'analysis'. Defaults to None. response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: List of modules with names, descriptions, and required datasets
Dataset requirements may include flexible types:
- BDS_DATASET: Works with any BDS-structured dataset
- BDS_CONTINUOUS: Works with BDS datasets containing continuous data
- BDS_BINARY: Works with BDS datasets containing binary outcomes
- Specific names (ADSL, ADTTE, ADAE): Require exact dataset match
Markdown format:
# Teal Modules (Package Name)
## module_name
**Description**: Module description
**Required Datasets**: ADSL, BDS_CONTINUOUS (or "None")
JSON format:
{
"modules": [
{
"name": "tm_t_ancova",
"description": "ANCOVA Table",
"required_datasets": ["ADSL", "BDS_CONTINUOUS"]
}
],
"count": 10
}Examples: - List all clinical modules: package="clinical" - List graphics modules: category="graphics" - Get machine-readable list: response_format="json"
Note: Use tealflow_get_module_details to see typical datasets and detailed requirements for modules with flexible dataset types.
| Name | Required | Description | Default |
|---|---|---|---|
| package | No | all | |
| category | No | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=true and destructiveHint=false. The description adds valuable behavioral context: describes return formats (markdown/JSON), explains flexible dataset requirement types (e.g., BDS_CONTINUOUS), and shows example output structures. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the purpose, followed by clear sections (Args, Returns, Examples, Note). It is detailed but every sentence adds value, including concrete format examples that compensate for lack of schema descriptions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 3 optional parameters, two output formats, and flexible dataset types. The description covers the listing function, filtering options, return structure, and links to a related tool for deeper details. Despite having an output schema, the description fully explains return values and usage, making it complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Even though schema description coverage is 0%, the description's Args section thoroughly explains each parameter, defaults, and allowed values (package, category, response_format). It also includes examples that map parameters to actual usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List all available Teal modules with their descriptions and dataset requirements' — a specific verb + resource. It also distinguishes from the sibling tool tealflow_get_module_details by noting its role in listing vs. getting detailed requirements.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit usage context: filtering by package and category, with examples ('List all clinical modules', 'List graphics modules'). It also directs users to tealflow_get_module_details for more details, giving a clear alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_search_modules_by_analysisARead-onlyIdempotent
Search for Teal modules that perform a specific type of analysis.
This tool helps find appropriate modules when you know what analysis you need but don't know which module to use. It uses structured analysis type categories combined with text search for comprehensive results.
Args: analysis_type (str, required): Type of analysis to search for (e.g., 'survival', 'safety', 'efficacy', 'data exploration', 'visualization', 'kaplan-meier', 'forest plot', 'cox regression', 'scatter plot'). response_format (str, optional): Output format - 'markdown' for human-readable or 'json' for machine-readable. Defaults to 'markdown'.
Returns: str: List of matching modules organized by relevance
Includes:
- Analysis category matches (structured)
- Module names and descriptions
- Required datasets (may include flexible types: BDS_DATASET, BDS_CONTINUOUS, BDS_BINARY)
- Category descriptions
Note: Dataset requirements may use flexible types. Use tealflow_get_module_details
to see typical datasets and tealflow_check_dataset_requirements to verify compatibility.Predefined Analysis Categories: Clinical: survival_analysis, safety_analysis, efficacy_analysis, descriptive_analysis, laboratory_analysis, patient_profiles General: data_exploration, statistical_analysis, visualization, data_quality, multivariate_analysis
Examples: - Find survival analysis modules: analysis_type="survival" - Find safety modules: analysis_type="safety" - Find visualization modules: analysis_type="visualization" - Find efficacy modules: analysis_type="efficacy"
| Name | Required | Description | Default |
|---|---|---|---|
| analysis_type | Yes | ||
| response_format | No | markdown |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so safety traits are covered. The description adds behavioral detail about the search mechanism ('uses structured analysis type categories combined with text search'), the return structure ('List of matching modules organized by relevance'), and a caveat about flexible dataset types. This goes beyond annotations without contradicting them, though it doesn't specify edge cases such as no matches.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but well-structured with clear sections (Args, Returns, Includes, Note, Categories, Examples). It front-loads the purpose and usage. Some content, like the predefined categories list and examples, is partly redundant, but it serves the agent by providing quick reference without requiring mental inference. Every section contributes to usability.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (2 params, 1 required), the description is comprehensive. It explains purpose, parameters, return format, result contents, flexible dataset types, and next-step tool references. The presence of an output schema reduces the need to detail return values, but the description still covers the essential content. No critical gap remains.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides zero description coverage (0%). The description fully compensates by documenting both parameters: analysis_type with a list of examples ('survival', 'safety', 'efficacy', etc.), and response_format with values, default, and semantics ('markdown' for human-readable, 'json' for machine-readable). This is more detailed than most schemas and gives the agent everything needed to choose valid values.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a clear verb+resource: 'Search for Teal modules that perform a specific type of analysis.' It explicitly states the tool finds modules based on analysis type, and further differentiates from siblings by noting it helps 'when you know what analysis you need but don't know which module to use.' This clearly distinguishes it from list_modules and get_module_details.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage context: 'when you know what analysis you need but don't know which module to use.' It also names alternatives for follow-up actions: 'Use tealflow_get_module_details to see typical datasets and tealflow_check_dataset_requirements to verify compatibility.' This gives the agent concrete guidance on when and how to use the tool relative to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_setup_renv_environmentAIdempotent
Prepare an R project directory so it is ready to run Teal Shiny applications.
This tool initializes an renv environment and installs required packages (shiny, teal, teal.modules.general, teal.modules.clinical).
Behavior:
If
renv.lockexists: Restores packages at locked versions, then installs only packages missing from the lockfile. User's pinned versions are respected.If no
renv.lock: Initializes a new renv environment and installs all packages.
Steps performed:
Validates project path and R installation
Installs renv package if missing
Initializes renv (or restores existing lockfile)
Installs required packages (only missing ones if lockfile exists)
Args: project_path (str, optional): ABSOLUTE path to the R project directory. MUST be an absolute path (e.g., "/home/user/project" or "C:\Users\user\project"). Relative paths like "." will resolve to the MCP server's directory, not the user's project. Defaults to "." but should always be explicitly provided as an absolute path. response_format (str, optional): Output format - 'json' or 'markdown'. Defaults to 'json'.
Returns: str: JSON/markdown with status, steps_completed, message, and logs_excerpt.
Error Types: - filesystem_error: Project path does not exist - rscript_not_found: R is not installed or not in PATH - renv_install_failed: Failed to install or initialize renv - package_install_failed: Failed to install required packages
Examples: - Setup current directory: (no parameters needed) - Setup specific project: project_path="/path/to/project"
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | . | |
| response_format | No | json |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate idempotentHint=true and destructiveHint=false, and the description aligns with these while adding significant detail: it discloses that locked versions are respected, only missing packages are installed when a lockfile exists, and initialization vs. restoration behavior. It also lists error types and the exact steps performed, providing transparency beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Though lengthy, the description is efficiently structured with headers (Behavior, Steps performed, Args, Returns, Error Types, Examples) and no redundant sentences. Every section adds value: behavior details, parameter warnings, error taxonomy, and example usage. It is appropriately sized for a tool with conditional logic and multiple failure modes.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is self-contained: it explains the tool's purpose, step-by-step process, inputs with warnings, output format, error types, and examples. The output schema existence is supported by a clear account of what is returned. Given the tool's moderate complexity (lockfile handling, R dependency installation), this description fully equips an agent to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, but the description fully compensates by explaining both parameters. It warns that project_path must be absolute, explains why relative paths resolve to the MCP server's directory, and specifies response_format values ('json' or 'markdown') with defaults. This adds crucial meaning that the schema lacks.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource statement: 'Prepare an R project directory so it is ready to run Teal Shiny applications.' It then clearly states it 'initializes an renv environment and installs required packages,' naming the exact packages. This distinguishes it from sibling tools like tealflow_snapshot_renv_environment, which handles snapshotting rather than setup.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context for when to use the tool: when preparing an R project to run Teal apps. The Behavior section explains how it handles existing vs. missing lockfiles, giving implicit guidance on when restoration vs. fresh initialization happens. However, it does not explicitly compare to alternatives (e.g., snapshot tool) nor state when not to use it, so it falls slightly short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tealflow_snapshot_renv_environmentAIdempotent
Create an renv snapshot of the current R project environment.
This tool captures the current state of installed R packages and records them in renv.lock. This creates a reproducible record of your project's dependencies that can be restored later or shared with others.
When to use this tool:
After installing new packages
After updating existing packages
Before sharing your project with others
To create a reproducible checkpoint of your environment
Requirements:
renv must already be initialized (use tealflow_setup_renv_environment first)
Project must have an active renv environment
Args: project_path (str, optional): ABSOLUTE path to the R project directory. MUST be an absolute path (e.g., "/home/user/project" or "C:\Users\user\project"). Relative paths like "." will resolve to the MCP server's directory, not the user's project. Defaults to "." but should always be explicitly provided as an absolute path. response_format (str, optional): Output format - 'json' or 'markdown'. Defaults to 'json'.
Returns: str: JSON/markdown with status, message, and logs_excerpt.
Error Types: - filesystem_error: Project path does not exist - rscript_not_found: R is not installed or not in PATH - renv_not_initialized: renv has not been initialized in this project - snapshot_failed: Failed to create renv snapshot - execution_error: Unexpected error during snapshot
Examples: - Snapshot current directory: (no parameters needed) - Snapshot specific project: project_path="/path/to/project" - Get markdown output: response_format="markdown"
Note: This tool only snapshots packages that are used in your project code. Make sure you have library() calls in global.R or your R scripts for packages you want to include in the snapshot.
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | . | |
| response_format | No | json |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide idempotentHint=true and destructiveHint=false. The description adds useful context about writing to renv.lock, only snapshotting packages used in project code, and lists specific error types. It does not contradict annotations, though it could be slightly more explicit about overwriting an existing lockfile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with markdown sections for purpose, usage, requirements, arguments, returns, errors, and examples. It is somewhat long, but every section contributes value, especially the absolute path warning and error type list. A slightly shorter version could be more concise, but the structure and front-loading are effective.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers when to use, prerequisites, parameter semantics, return value summary, error types, and a note about library() calls. Since an output schema exists, the lack of detailed return format documentation is acceptable. The context is complete for a well-understood tool with moderate complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero descriptions, but the description fully compensates by explaining that project_path must be an absolute path and warning about relative path resolution, and by defining response_format values ('json' or 'markdown'). This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Create an renv snapshot of the current R project environment.' with a specific verb ('Create'), resource ('renv snapshot'), and scope ('current R project environment'). It clearly distinguishes from the sibling tool tealflow_setup_renv_environment by noting that renv must be initialized first.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
An explicit 'When to use this tool' section lists concrete scenarios such as after installing or updating packages, before sharing, and for reproducibility. It also provides a requirement referencing tealflow_setup_renv_environment, which acts as a clear alternative/context for when this tool should not be used.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: listing modules, getting module details, searching by analysis, checking dataset compatibility, discovering datasets, inspecting dataset info, generating code, and managing the environment. Even similarly named tools like list_datasets and discover_datasets serve different functions (enumerating standard datasets vs. scanning a directory).
All tools follow a consistent tealflow_ verb_noun pattern (list, get, search, check, discover, generate, setup, snapshot). The only exception is tealflow_agent_guidance, but it is a meta-tool for initial instructions and does not break the overall consistency.
14 tools provide comprehensive coverage for Teal application development without redundancy. Each tool addresses a distinct step in the workflow from guidance and discovery to code generation and environment validation.
The tool set covers the full lifecycle of Teal app development: initial guidance, module and dataset discovery, compatibility checks, code generation for data and modules, startup validation, and environment setup/snapshotting. There are no obvious dead ends or missing operations.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Medical RAG: semantic search for clinical guidelines, drug interactions, diagnoses & EHR data.
Medical RAG: semantic search for clinical guidelines, drug interactions, diagnoses & EHR data.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables LLM-based agents to interact with FHIR healthcare data through natural language prompts, providing full CRUD operations on FHIR resources, document processing, and semantic search capabilities.1398MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language exploration of OMOP CDM databases for concept discovery, patient count queries, and cohort SQL generation with support for multiple database backends.1MIT
- FlicenseNot gradedqualityBmaintenanceEnables LLMs to interact with clinical patient records using tools for document ingestion, structured conversion, patient profiling, record listing, search, and secure Q&A over patient documentation.
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables LLMs to securely query synthetic clinical data through validated, scoped tools (patient summaries, conditions, medications, lab trends, encounters) while maintaining audit logs and access controls.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Appsilon/TealFlowMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server