Skip to main content
Glama

tealflow_get_app_template

Read-onlyIdempotent

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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.

Conciseness4/5

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.

Completeness5/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

Install Server

Other Tools

Latest Blog Posts

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