Skip to main content
Glama
r-packagedev-mcp

r-packagedev-mcp

by B0ydT

test_dir

Runs all test files in a directory with testthat, optionally filtered, and returns pass/fail/skip counts.

Instructions

Run all test files in a directory (optionally filtered) using testthat::test_dir(). Returns a summary of pass/fail/skip counts.

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": {
      "path": "<path>"
    },
    "name": "test_dir"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path to the directory containing test files.
filterNoRegex pattern to restrict which test files are run (e.g. 'my_func').
reporterNotestthat reporter to use (e.g. 'progress', 'summary', 'tap'). Defaults to 'progress'.
stop_on_failureNoWhether to stop immediately on the first test failure (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose the return shape ('summary of pass/fail/skip counts') and the underlying function, which is useful, but it omits that this executes arbitrary test code with side effects, how failures/errors are surfaced, and what working-directory or package-loading assumptions apply.

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?

Two short sentences, zero waste, with purpose front-loaded and the return value stated second. Nothing is padded or repeated.

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

Completeness4/5

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

For a simple four-parameter tool with fully documented schema, the description covers what it does, the underlying function, and what it returns. The remaining gaps are execution safety and sibling routing, the latter of which is a usage-guideline concern rather than a completeness hole in the core description.

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 description coverage is 100%, so all four parameters (path, filter, reporter, stop_on_failure) are already fully documented with examples and defaults. The description only echoes the filter as 'optionally filtered' and adds no syntax, format, or interaction details beyond the schema.

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?

States a specific verb+resource ('Run all test files in a directory') and names the underlying implementation (testthat::test_dir()), which makes the scope concrete. The directory-vs-file distinction implicitly separates it from the sibling test_file, but that sibling is never named, so it falls short of full sibling differentiation.

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

Usage Guidelines3/5

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

Usage is only implied: run this when you have a whole directory of test files. There is no explicit guidance on when to prefer test_file or test instead, no prerequisites (e.g. whether the package must be loaded first), and no exclusions. The parenthetical '(optionally filtered)' hints at the filter parameter's purpose but is not usage guidance.

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