Skip to main content
Glama
r-packagedev-mcp

r-packagedev-mcp

by B0ydT

use_testthat

Configure testthat testing infrastructure for an R package by creating tests/testthat/ and adding testthat to Suggests.

Instructions

Configure the testthat testing infrastructure for a package using usethis::use_testthat(). Creates tests/testthat/ and adds testthat to Suggests.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_path": "<project_path>"
    },
    "name": "use_testthat"
  }
}

Input Schema

NameRequiredDescriptionDefault
editionNotestthat edition to use (e.g. 3). Defaults to latest stable edition.
project_pathYesAbsolute path to the root of the R package.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full burden. It does disclose the two substantive side effects (creating tests/testthat/ and appending testthat to Suggests), which is real value, but it omits whether the call is idempotent, what happens if the package is already configured, and whether the edition choice writes anything into DESCRIPTION beyond Suggests.

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?

Two sentences, front-loaded with the action and backed by a compact list of effects; nothing is padded or redundant. It is slightly thin for a scaffolding tool, but every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With only two fully documented parameters, no output schema, and no annotations, the definition is close to sufficient. What is missing is the operational context an agent needs to pick it correctly: its position in the setup workflow relative to use_test, and how it behaves on re-invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and both the edition (integer, defaults to latest stable) and project_path (absolute path to package root) are fully documented in the schema. The description adds nothing beyond that, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: 'Configure the testthat testing infrastructure' via usethis::use_testthat(), and enumerates the concrete effects (tests/testthat/ directory, testthat in Suggests). It does not, however, distinguish this scaffolding step from the sibling use_test (which adds individual test files) or test/test_dir/test_file (which run tests), so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance, no prerequisite stated (e.g., that it belongs in one-time package setup and typically precedes use_test), and no note that the project must already be an R package. Use is only implied by the verb 'Configure'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.