Skip to main content
Glama
r-packagedev-mcp

r-packagedev-mcp

by B0ydT

document

Generate roxygen2 reference pages and update NAMESPACE for an R package by reading @-tags and creating man/*.Rd files.

Instructions

Generate roxygen2 documentation and update NAMESPACE using devtools::document(). Reads @-tags from R source and creates man/*.Rd files.

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": "document"
  }
}

Input Schema

NameRequiredDescriptionDefault
rocletsNoCharacter vector of roclet names to use (e.g. ['rd', 'namespace']). Defaults to all.
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.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose real side effects: it reads @-tags from R source, writes man/*.Rd files, and rewrites NAMESPACE. That is genuinely useful behavioral context beyond the schema. It stops short of saying whether existing .Rd files or hand-edited NAMESPACE entries are overwritten, which is the main risk an agent would want flagged.

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 filler, and the primary action is front-loaded ahead of the mechanism detail. Nothing is repeated and nothing is padding.

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, no-output-schema tool with fully described params, the definition covers what it produces and what it modifies. The remaining gap is operational: error conditions and whether prior generated files are replaced before writing.

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 project_path and roclets are already documented in the schema, including the default for roclets. The description adds no extra meaning about either parameter, so the baseline 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 pairs a specific verb ('Generate ... documentation', 'update NAMESPACE') with a concrete resource (roxygen2 man/*.Rd files) and names the underlying call (devtools::document()). It is unmistakable against siblings like build or check, though it never explicitly contrasts itself with any of them.

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: an agent can infer this applies to an R package with roxygen2 @-tags in source. There is no explicit statement of when to run this versus build/check, no prerequisites (e.g., package must be loadable), and no exclusions.

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