Skip to main content
Glama

mutation_test

Verify assertions by applying an explicit code mutant, confirming it compiles, and running a scoped test set. Distinguishes real checks (KILLED) from vacuous ones (SURVIVED) without false kills, then restores the original file.

Instructions

Mutation-test your own assertions: apply an explicit mutant, prove it still COMPILES, run a scoped test set, classify the result, and restore the file — the check that tells a real assertion from a vacuous one. Takes explicit mutants only (file_path + exact-once old_string/new_string, like edit_file); it does not generate them. Three outcomes: KILLED (mutant compiled and a test failed — the assertion is real), SURVIVED (mutant compiled and every test still passed — the assertion is VACUOUS, the finding that matters), and INVALID (the mutant did not apply, did not compile, could not be started, or timed out — it proves nothing and is NEVER reported as a kill; that false kill is why the compile gate exists). Scope the run with test_target, which fills the stored test command's {target} placeholder (topology_affected says which tests to name) — the shipped go/python/rust test defaults carry one, so scoping works out of the box. Commands are the stored, trust-gated [tasks.] slots run_task uses; you cannot pass a command line. Restoration is guaranteed on every exit path (pass, fail, compile error, timeout, panic, cancellation): the pre-mutation bytes are snapshotted in memory, rewritten under the same per-path lock, and SHA-256-verified before the run is reported clean. It REFUSES to touch a file with uncommitted changes (untracked included), no override — a clean file means git checkout recovers it if the daemon dies mid-run; that is the recovery story. It also refuses to start unless the workspace BUILDS and its tests PASS unmutated: a kill means "green before, red after", so against an already-red suite every mutant reads as killed for a reason unrelated to it. The refusal says which happened — suite red, command timed out, or could not start — because only the first is about your code. One mutation run at a time per daemon; a second call is refused rather than queued.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mutantsNoThe mutants to test, applied and restored ONE AT A TIME. Each is an exact-once str_replace in the style of edit_file.
test_taskNoWhich stored [tasks.<lang>] slot runs the tests. Default "test". The built-ins are build, lint, test, e2e and verify; a project-defined slot works here too.
test_targetNoOptional value for the test command's {target} placeholder — THE way to scope the run to the affected package or test instead of the whole suite (ask topology_affected which). The shipped go/python/rust test defaults carry a defaulted placeholder, so this works with no config edit; a hand-written test command needs a {target} token of its own or the target is refused. Scoping matters: each mutant costs a full compile+test cycle, so the whole suite per mutant is the difference between minutes and tens of minutes. One shell-safe argument ([A-Za-z0-9._/:@-]).
compile_taskNoWhich stored slot proves the mutant COMPILES before its tests are trusted. Default "build". It always runs unscoped (no {target}) — a whole-module compile catches breakage a scoped test never reaches. Cannot be disabled: without it a non-compiling mutant looks exactly like a kill. The built-ins are build, lint, test, e2e and verify; a project-defined slot works here too.
timeout_secondsNoPer-step timeout for the compile and test commands. Default 600.
Behavior5/5

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

With no annotations provided, the description carries full behavioral disclosure. It reveals the compile gate, the restoration guarantee on every exit path with SHA-256 verification, refusals on uncommitted changes and non-green suites, and the meaning of each outcome (KILLED/SURVIVED/INVALID). Nothing is left opaque.

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?

Though long, every sentence adds essential information. The structure is logical: purpose → process → outcomes → scoping → commands → safety → constraints. It is front-loaded with the purpose and each segment earns its place; there is no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is complex, but the description covers all critical aspects: the exact process, the three outcome meanings, scoping via test_target and topology_affected, the stored command source, restoration guarantees, refusal conditions, and concurrency. It references sibling tools for supplementary info and fully explains the expected behavior even without an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all 5 parameters. The description adds significant semantic value beyond the schema: exact-once requirement for old_string, empty-string deletion semantics, the {target} placeholder mechanics for test_target, the unscoped compile_task, and default timeout. This goes well past the baseline 3.

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 states a specific verb and resource ('Mutation-test your own assertions') and outlines the full process (apply mutant, compile, run tests, classify, restore). It explicitly distinguishes itself from mutant-generating tools and references edit_file for exact-once str_replace semantics, making it clearly distinct from siblings.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (explicit mutants only, not generated) and when-not-to-use (uncommitted changes, non-green baseline, concurrent runs). It names sibling tools for supplementary decisions (topology_affected for scoping, run_task for stored commands) and states the single-run concurrency constraint.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server