Skip to main content
Glama

tealflow_setup_renv_environment

Idempotent

Prepare R project for Teal Shiny apps by initializing renv and installing required packages. Restores locked versions if lockfile exists, otherwise installs all.

Instructions

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.lock exists: 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:

  1. Validates project path and R installation

  2. Installs renv package if missing

  3. Initializes renv (or restores existing lockfile)

  4. 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"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathNo.
response_formatNojson

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters5/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

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