Skip to main content
The EvalSuite class groups multiple EvalTest instances and provides aggregate metrics across all tests.

Import

Constructor

Parameters

EvalSuiteConfig
Configuration for the evaluation suite.

EvalSuiteConfig

matchOptions is a default, not an override: a test that sets its own keeps it. This mirrors how the hosted product layers suite → case, so a suite behaves the same whether it runs from your test file or from the platform.
When an API key is available — via mcpjam.apiKey or the MCPJAM_API_KEY environment variable — all test results are consolidated into a single run and saved to MCPJam after the suite completes. Individual EvalTest auto-saves are suppressed to avoid duplicate uploads. Set mcpjam.enabled: false to disable.

Example

With results saved to MCPJam:

Methods

add()

Adds a test to the suite.

Parameters

Example


run()

Runs all tests in the suite and returns aggregate results.

Parameters

EvalTestRunOptions

EvalSuiteResult

Example

Tests within the suite run sequentially, but each test’s iterations can run concurrently based on the concurrency setting.

accuracy()

Returns the aggregate accuracy across all tests.

Returns

number - Average accuracy of all tests (0.0 - 1.0).

Example


get()

Retrieves a specific test by name.

Parameters

Returns

EvalTest | undefined - The test, or undefined if not found.

Example


getAll()

Returns all tests in the suite.

Returns

EvalTest[] - Array of all tests.

Example


getName()

Returns the suite’s name.

size()

Returns the number of tests in the suite.

getResults()

Returns the full suite results from the last run.

recall()

Aggregate recall across every test in the suite that declared expectedToolCalls.

precision()

Aggregate precision across every test in the suite that declared expectedToolCalls.
Changed in 3.0. These returned accuracy() — the suite’s pass rate — under all three names. They now aggregate real tool-call counts and throw when no test in the suite declared expectedToolCalls. Tests without expectations are skipped in the aggregate rather than counted as perfect. See EvalTest.precision() for how the counts are derived.

truePositiveRate()

Aggregate true positive rate (same as recall).

unexpectedToolCallRate()

The fraction of expectation-bearing iterations across the suite that made at least one tool call nobody asked for.

falsePositiveRate()

Deprecated in 3.0 — use unexpectedToolCallRate(). It returned failures / iterations, which is the failure rate. Suites with no expectedToolCalls still get that legacy value; suites with expectations now delegate to unexpectedToolCallRate().

averageTokenUse()

Returns average tokens per iteration across all tests.

Properties

name

The suite’s name (via getName()).

Complete Example


Patterns

CI Quality Gate

Per-Test Thresholds

Comparing Across Providers