tealflow_get_app_template
Retrieve the base R template for building Teal apps, including data loading, dataset configuration, and initial module setup. Use it as a starting point to scaffold clinical trial analysis applications.
Instructions
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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "tealflow_get_app_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |