Skip to main content
Glama

Generate a JUnit 5 replay test from recorded cases

migrate_replay
Idempotent

Generate a JUnit 5 ReplayTest that replays recorded JSONL cases against a Java port, checking method outputs, JS-only sentinels, and thrown errors.

Instructions

Generate a JUnit 5 test (ReplayTest) that replays the JSONL cases recorded by migrate_record against the Java port class: invokes each ported method with the recorded arguments and compares values, including JS-only sentinels (undefined, -0, NaN, Infinity, bigint) and throws. Running 'mvn test' on the generated project is the replay. Inspiration: rust-anything (MIT).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "migrate_replay"
  }
}

Input Schema

NameRequiredDescriptionDefault
casesNoPath to the .jsonl cases file recorded by migrate_record
classNoJava port class: simple name (with 'package') or fully-qualified
outputNoExplicit .java file path for the test (must end with .java)
packageNoPackage for the generated test (default: derived from 'class', else com.migrated)
projectNoGenerated Maven project root; the test is written to src/test/java/<package>/ (default: next to the cases file)

Output Schema

NameRequiredDescriptionDefault
errorNo
messageNo
successYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare it is a non-destructive, idempotent, non-open-world write; the description adds that it emits a .java test file into a project tree and that generated assertions cover JS-only sentinels and throws. It does not say whether an existing ReplayTest file is overwritten, which is the main remaining behavioral unknown.

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?

Front-loaded with the generated artifact and its purpose in one dense sentence, followed by the 'mvn test' usage note. The closing 'Inspiration: rust-anything (MIT)' line is attribution filler that does not help an agent call the tool.

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?

With an output schema, full parameter coverage, and annotations already supplied, the description covers what is produced, what it asserts, and how the result is exercised. Only the prerequisite chain (record cases, have a ported class) is left implicit.

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 five parameters are already documented. The description reinforces that `cases` is the migrate_record output and `class` is the Java port target, but adds no format or path details beyond the schema — the 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 artifact: 'Generate a JUnit 5 test (ReplayTest) that replays the JSONL cases recorded by migrate_record against the Java port class.' It ties the tool to a named sibling as the upstream producer, making it distinct from migrate_record and generate_database.

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 context is clear: cases must come from migrate_record, and 'Running mvn test on the generated project is the replay' tells the agent what happens next. It stops short of an explicit ordering statement or exclusions (e.g., what to do instead if there is no port class yet).

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