Skip to main content
Glama
r-packagedev-mcp

r-packagedev-mcp

by B0ydT

use_package

Adds an R package dependency to the DESCRIPTION file, choosing Imports, Suggests, Depends, LinkingTo, or Enhances to keep package metadata correct.

Instructions

Add a package dependency to DESCRIPTION using usethis::use_package(). Supports Imports, Suggests, Depends, LinkingTo, and Enhances.

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

Input Schema

NameRequiredDescriptionDefault
typeNoDependency type in DESCRIPTION (default 'Imports').Imports
packageYesName of the R package to add as a dependency.
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.4/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It does disclose the key behavior — the target artifact is the DESCRIPTION file and the operation is a mutation via usethis::use_package() — but says nothing about idempotency (what happens if the package is already listed), whether the package must exist on CRAN, whether it errors or warns, or that it does not install the package. These gaps matter for a file-mutating tool.

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 tight sentences, front-loaded with the action and target file. The second sentence repeats the enum values already in the schema, which is mild redundancy but keeps the definition self-contained and short.

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?

For a three-parameter mutation tool with no annotations and no output schema, the description covers what is modified but not the outcome (return value, messages) or edge-case behavior. The fully documented schema compensates for the parameter side, leaving behavioral disclosure as the main shortfall.

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 three parameters are already documented, including the default 'Imports'. The description only restates the enum values already present in the schema and adds no new meaning about package naming, path expectations, or interaction between parameters. Baseline 3 applies.

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?

States a specific verb and resource ('Add a package dependency to DESCRIPTION') and names the underlying mechanism (usethis::use_package()), which makes it unambiguous against siblings like use_data, use_git, or install. It also enumerates the supported dependency types, so an agent knows the scope of the operation without opening the schema.

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 usage is implied — call this when you want to declare a dependency in an R package's DESCRIPTION — but there is no explicit when-to-use/when-not guidance and no mention of alternatives (e.g., manually editing DESCRIPTION, or install for actually obtaining the package). Prerequisites such as an existing valid package project at project_path are also unstated.

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