Skip to content

Rejection schema reference

Every rejected MCP tool call returns the same JSON shape. Agents pattern-match on error_code and use the remediation hint as the next-action signal — no natural-language parsing required.

{
"passed": false,
"error_code": "INPUT_REJECTED_DANGEROUS_FLAG",
"error": "rejected MCP input testArgs[0]=\"--rootdir=/tmp\": flag \"--rootdir\" can load arbitrary code via the underlying test runner; not allowed from MCP input",
"summary": "Rejected unsafe MCP input",
"remediation": "Remove the rejected flag from testArgs. The flag can load arbitrary code via the underlying test runner and is denied from MCP input. If you need it for trusted CLI use, run coverctl directly without MCP."
}
error_codeWhen emittedRecovery hint
INPUT_REJECTED_DANGEROUS_FLAGTest arg matches a denylist flag (e.g. --rootdir, -D, --require).Remove the flag; run via terminal CLI for trusted use.
INPUT_REJECTED_SHELL_METACHARField contains shell metacharacters (“ ` $ ;& < > “, newline).
INPUT_REJECTED_CONTROL_CHARSField contains NUL or CR/LF bytes.Strip control bytes.
INPUT_REJECTED_INVALID_TAGStags does not match [A-Za-z0-9_,]+.Pass alphanumeric, comma-separated identifiers.
INPUT_REJECTED_INVALID_TIMEOUTtimeout is not Go duration syntax.Use 30s, 10m, 1h30s, …
INPUT_REJECTED_INVALID_RUN_PATTERN-run filter contains shell-injection markers.Use plain regex; remove backtick / $(...) / ;.
INPUT_REJECTED_PATH_SCOPEPath input resolves outside the working directory.Use a path inside the project root.
OP_CONFIG_EXISTSinit called when .coverctl.yaml already exists.Pass force: true to overwrite.
OP_DETECT_FAILEDAuto-detection found no language markers.Pass language explicitly or run from a project root.
OP_INVALID_PATHPath could not be cleaned/validated.Use a path inside the working directory.
OP_FILE_WRITE_FAILEDFilesystem error creating or writing config.Check permissions and disk space.
OP_RATE_LIMITEDpr-comment exceeded five calls per five minutes per PR.Wait or coalesce updates.
OP_MODULE_ROOT_MISSINGCould not resolve Go module root from cwd.Run from inside a Go module, pass --language for non-Go repos, or check for nested submodules.
INPUT_REJECTED_OTHERUnclassified input rejection.Inspect error for details.

The schema is append-only:

  • New error_code constants may be added to handle previously unclassified failures.
  • Existing codes will not be renamed or repurposed without a major-version bump.
  • The five required fields (passed, error_code, error, summary, remediation) are permanent. Additional fields may be added.

This contract is what lets agents recover deterministically from rejection without guessing or hallucinating fixes.

  • internal/mcp/sanitize.go — rejection codes + remediation copy
  • internal/mcp/runtime_errors.go — typed-error classifier
  • internal/mcp/sanitize_test.go
  • internal/eval/scenarios/ — adversarial regression suite