Skip to main content
Glama
r-packagedev-mcp

r-packagedev-mcp

by B0ydT

use_r

Creates a new R source file under R/ in an existing package with minimal boilerplate, adding R/.R for organized package source code.

Instructions

Add a new R source file under R/ in an existing package using usethis::use_r(). Creates 'R/.R' with minimal boilerplate.

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": {
      "name": "<name>",
      "project_path": "<project_path>"
    },
    "name": "use_r"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesName of the R script (without .R extension).
project_pathYesAbsolute path to the root of the R package.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does disclose the underlying implementation (usethis::use_r()) and the exact artifact produced ('R/<name>.R' with minimal boilerplate). It omits what happens on name collision (overwrite vs. error), whether the file is opened in an editor as a side effect, and whether parent directories are created, which are meaningful gaps for a file-creating mutation.

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 compact sentences with the core action front-loaded and the concrete output described second. Nothing is wasted, though the second sentence slightly repeats the path information already implied by the first.

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 two-parameter, fully documented tool with no output schema, the description covers what it does, the prerequisite context, and the resulting artifact. The remaining gap is edge-case behavior on existing files, which is minor relative to the tool's simplicity.

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 both parameters are already documented in the input schema, establishing a baseline of 3. The description only restates the composition of the filename ('R/<name>.R'), adding marginal meaning beyond the schema and nothing about path validation or relative-vs-absolute handling.

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 ('Add a new R source file under R/') plus a constraint ('in an existing package'), which is far more precise than the bare name. It does not explicitly distinguish itself from similar siblings such as use_test or use_vignette, so differentiation relies on the reader's interpretation of the sibling names.

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?

The phrase 'in an existing package' implies the prerequisite that a package must already exist (i.e., use create_package first), which is useful implicit guidance. However, there is no explicit when-to-use/when-not statement, no mention of what to do instead if the file already exists, and no named alternative for creating a package from scratch.

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