Skip to navigation

get_test_runs

Retrieves test run results for an AI Agent. Use this to review pass/fail status, evaluation criteria outcomes, and rationale after triggering a test_run via edit_agent_config.

Test runs pinned to a change set are retrieved here too. By default, the tool returns the latest run per test case and change set, including live runs. The results can include several runs for the same test case.

Simulations shows each test case’s latest result across live and change set runs.

Example prompts

  • “Show me the latest test run results for each of my test cases.”
  • “Which test cases failed in the last run, and why?”
  • “Get the full details for test run abc123.”

Parameters

ParameterTypeDescription
test_run_idstringOptional. Return full details for a single test run.
status_filterarray of stringsOptional. Limit to runs with the given statuses: pending, simulating, evaluating, completed, failed, timeout, or cancelled. Pass or fail is reported per run as did_pass, not through this filter.
test_case_idsarrayOptional. Restrict results to runs for specific test case IDs.
changeset_idsarray of strings or nullsOptional. Omit or pass [] for live runs and all change sets. Pass [null] or ["baseline"] for live runs only. Pass change set IDs to select specific change sets. Include null or "baseline" in the same list to also include live runs.
include_historybooleanOptional. Defaults to false, returning the latest run per test case and change set. Set to true to include matching historical runs.
include_transcriptbooleanOptional. Requires test_run_id. Defaults to true. Set to false to leave out the transcript items when the conversation lines are all you need.
cursorstringOptional. Opaque cursor returned as next_cursor by the previous call. Omit it to fetch the first page. Pass the same other parameters as the call that returned it.

Pagination

Both reads are paged. If the response has a non-null next_cursor, pass it back as cursor to fetch the next page. Repeat until next_cursor is null before you answer a question about the whole set. A pass rate and a count are examples of such a question.

A single run fetched by test_run_id is paged by size. If the run changes between calls, for example because it finishes, the tool rejects the cursor. Call again without cursor to start from the first page. An item too large for one page arrives with its longest text cut and a truncated_fields list that names the cut fields. The full text of those fields is not available through this tool.

Response

When listing, returns test_runs and next_cursor. A page holds up to 100 runs. Each run includes:

  • Test run ID, test case ID, and change set ID. Live runs have a null change set ID.
  • Status, overall pass/fail result, and the failure code when the run failed.
  • Per-evaluation-criterion outcomes and rationale.

When requesting a single run by test_run_id, the first page holds the run’s fields. They include its status, test case ID, change set ID, timestamps, and the user who triggered it. Every page returns items, total_count, and next_cursor. Each item has a part, in this order:

  • criteria_result: the outcome and rationale for one evaluation criterion.
  • custom_metric_result: the result of one custom metric.
  • classification: one classification of the simulated conversation.
  • simulated_call: one API tool call that the simulation answered.
  • conversation: one readable line of the simulated conversation, in its line field. The lines are the text the success criteria judge reads. They leave out MCP tool calls, code tool runs, and Playbook steps.
  • transcript: one entry of the simulated conversation transcript that the evaluation was based on.
  • test_case_snapshot: the test case as it was when the run started.