Skip to main content
Glama

Reproducible SAS/R/Python code / 生成可复现 SAS/R 代码

sas_r_code
Read-onlyIdempotent

Reproducible SAS/R/Python code / 生成可复现 SAS/R 代码 | USE WHEN: generate the SAS / R / Python code that reproduces a given analysis | ALIASES: SAS代码, R代码, 复现代码, reproducible code, Python代码, 统计代码 | RETURNS: 推荐统计方法与代码

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": {
      "design": "<design>"
    },
    "name": "sas_r_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
designYes研究设计
n_groupsNo组数(整数,默认 2)。决定生成的 SAS/R 代码里两两比较的分组数;多组会额外生成多重比较校正代码。
outcome_typeNo结局类型

Output Schema

NameRequiredDescriptionDefault
costNo
resultYes业务字段,键见 description 的 RETURNS 段
successYes
data_sourceYeslocal_computation|external_corpus|llm_generated|user_data|pending
engine_statusYesok|queued|error|unavailable|not_run

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed1 schema field changed
    • changedInput schema / properties / n_groups / description
      Previous value: -"组数"New value: +"组数(整数,默认 2)。决定生成的 SAS/R 代码里两两比较的分组数;多组会额外生成多重比较校正代码。"
  4. Added

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare that this tool is read-only, idempotent, closed-world, and non-destructive, so the safety profile needs no explanation. The description adds that it returns the recommended statistical method and the code, but an output schema already exists, so the return description adds little context beyond the annotations.

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?

The definition is compact and front-loaded, with a labeled structure (USE WHEN, ALIASES, RETURNS). It repeats the tool name bilingually and its alias list is long, but these are minor overheads against an otherwise efficient definition.

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?

The annotations, the 100%-covered schema, and the output schema carry the weight, so the description only needs to establish purpose and trigger, and it does both. The remaining gap is the undefined boundary between code generation and the sibling tools that perform analyses.

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%, and with three parameters the schema already documents design, n_groups, and even the multi-group correction behavior. The description adds no meaning about the parameters beyond what the schema provides, so the baseline score of 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 definition gives a specific verb and resource: it generates the SAS/R/Python code that reproduces a given analysis. The purpose is distinct from the analysis siblings (kaplan_meier, linear_mixed_model) because it generates code rather than running an analysis, but it never says so explicitly, and the title omits Python even though the description includes it.

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

Usage Guidelines4/5

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

The phrase 'USE WHEN: generate the SAS / R / Python code that reproduces a given analysis' states the trigger condition clearly, which is more than most definitions offer. It does not name when-not-to-use cases or alternatives, and it does not distinguish code generation from the sibling tools that actually execute analyses.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources