runSuiteFile(sourceText, options) runs an MCPJam suite file locally and decides it with the v2 verdict policy. It is the engine behind mcpjam test, exposed for code that wants the same run without the CLI.
It takes explicit configuration: server bindings, provider keys, and — only if a case needs MCPJam-hosted inference — a callback that returns a platform connection. It does not discover files, read environment variables or a login store, print, write artifacts or exit the process. It never uploads results and sends no usage telemetry — that belongs to the caller.
Options
Result
Nothing in the result carries a provider key, a platform token, a lease, server headers or environment objects. Every credential the run was handed — provider keys, platform tokens, server credentials, and any header, environment or URL value whose name or shape marks it as one (
Authorization, GITHUB_TOKEN, ?sig=, a ghp_… token) — is replaced with [REDACTED] wherever observed text repeats it: execution errors, tool-call arguments, evaluator and predicate reasons, issues and warnings. Ordinary configuration such as NODE_ENV=production is not treated as a secret. Identifiers (case ids, server and tool names) and fixed vocabularies such as statuses are never rewritten.
Errors
Input that cannot run and environments that cannot be set up throwSuiteFileRunError with a stable code, a phase (validation, setup, execution, reporting) and a category. Validation and setup refusals are thrown before any model or tool call. A refusal that found concrete problems also lists every one found at that stage in details.problems; other errors carry only their message, so treat problems as optional.
One error comes after execution: REPORT_INVALID (phase reporting, category integrity) means the cases ran — model calls were made and may have been billed — but the run’s own report failed validation, so no result is returned. Retrying repeats that inference.
An iteration that failed its assertions is evidence, not an error: it comes back in the result. A provider refusal during execution is attributed on the iteration (
refusal) and never counted as a failing assertion.
