Skip to main content
Glama
r-packagedev-mcp

r-packagedev-mcp

by B0ydT

use_data

Export R objects already loaded in the workspace as package data files under data/ using usethis::use_data, with an option to overwrite existing files.

Instructions

Export one or more R objects as package data files under data/ using usethis::use_data(). The objects must already be loaded in the R environment.

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

Input Schema

NameRequiredDescriptionDefault
overwriteNoOverwrite existing data files (default false).
object_namesYesCharacter vector of R object names already loaded in the workspace to export as package data.
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.7/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 behavioral burden. It does disclose the key mutation (files written under data/) and the prerequisite state, but it omits side effects an agent would care about for a write tool: whether data/ is created if absent, whether DESCRIPTION (LazyData/Depends) is touched, and what happens when a target file already exists beyond the schema's overwrite flag.

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 sentences, zero filler, with the core action front-loaded and the precondition placed after it. Nothing is repeated or padded.

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 purpose and one precondition but leaves the side-effect profile (directory creation, DESCRIPTION mutation, collision behavior) unstated. Given 100% schema coverage the parameter side is adequate, but the behavioral side is only minimally complete.

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 in structured form and the baseline is 3. The description only restates the 'objects must already be loaded' constraint that the object_names field already expresses, adding no new semantics for project_path or overwrite.

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?

The description names a specific verb and resource ('Export ... R objects as package data files under data/') and cites the underlying implementation (usethis::use_data()), which lets an agent tell immediately that this writes package data rather than performing any of the other usethis::use_* scaffolding tasks in the sibling set.

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?

It states one useful precondition ('objects must already be loaded in the R environment'), which effectively implies when the tool is applicable, but it offers no when-not guidance, no mention of alternatives (e.g., saving non-package data), and no note about what to do if data/ does not yet exist.

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