Skip to main content
POST
Create an eval run (async)

Authorizations

Authorization
string
header
required

MCPJam API key (sk_…). Create one at Settings → API keys. Guest sessions cannot use the API, and API keys cannot manage other API keys.

Path Parameters

projectId
string
required

ID of the hosted project that contains the server.

Body

application/json

Two valid shapes: suiteId (rerun an existing suite, optionally upserting inline tests into it) or suiteName + tests + serverIds (create a new suite and run it). Inline tests alone — without a suiteId or a suiteName — are rejected with VALIDATION_ERROR.

environmentId requires suiteId: an environment is launchable only through a suite that has it attached (environmentIds, set via PATCH /eval-suites/{suiteId}), so an environment run on a not-yet-created suite could never be satisfied. environmentId and serverIds are mutually exclusive.

suiteId
string
required

Existing suite to rerun. A bare suiteId with no tests reruns the suite exactly as configured.

suiteName
string

Name for a new suite. Required (non-empty) when no suiteId is given.

suiteDescription
string
tests
object[]

Inline test cases to upsert into the suite before running.

Maximum array length: 100
serverIds
string[]

Servers (by ID) the run connects to. Required when creating a new suite; optional on reruns — when omitted, the run connects the suite's saved server selection (the set its snapshot references). A rerun of a suite with no saved selection is rejected with VALIDATION_ERROR (details.reason: "NO_SAVED_SERVER_SELECTION"). Rejected outright for a suite with attached environments (details.reason: "ENVIRONMENT_SERVERS_NOT_OVERRIDABLE"): the environment supplies a closed set that a server override cannot change, so accepting one would connect a different set than the run is stamped with.

Minimum array length: 1
modelApiKeys
object

Optional per-provider model API keys (e.g. { "anthropic": "sk-ant-…" }). Falls back to your organization's configured providers when omitted.

notes
string
passCriteria
object
iterationOverride
integer

Override the per-case runs count for this run only.

Required range: 1 <= x <= 10
environmentId
string

Run against one of the suite's attached project environments. Requires suiteId, and must be a member of that suite's environmentIds — otherwise 400 with details.reason: "ENVIRONMENT_NOT_ATTACHED", raised before any case is authored or any server connected.

Omission is meaningful: a suite with no attached environments runs legacy; a suite with exactly ONE attached environment runs against it automatically (the response's environment says which); a suite with several returns 400 with details.reason: "ENVIRONMENT_REQUIRED", naming the candidates.

The environment supplies the closed server set (so serverIds is not required, and is rejected alongside it), and the run is pinned to the revision resolved at launch — if the environment changes in between, the run is rejected with 409 rather than executing against a different configuration.

Response

Run created; execution continues in the background.

runId
string
required
suiteId
string
required
status
string
required
Allowed value: "running"
caseUpsert
object
required

Per-case upsert outcomes for inline tests. Partial failures don't abort the run.

servers
object[]

The servers the run connects to — explicit or derived from the suite's saved selection. name is present when known (always, on the derived path).

environment
object | null

The project environment a run is pinned to, at the revision resolved when it launched. null for a legacy run that used the suite's saved server selection.