Context

Retrieve structured test failure context for AI debugging.

The Context endpoint provides test failure data in JSON or Markdown format, suitable for feeding into AI tools and MCP integrations. It supports three detail levels:

  • Run-level: Summary of all failures across a run

  • Instance-level: Failures within a single spec file

  • Test-level: Full detail for a single test attempt

Get test failure context

get
/context

Retrieve structured test failure context for AI debugging. One of three query shapes is used:

  • Run-level: run_id only (omit instance_id and test_id). Paginate failed tests with limit and page.

  • Instance-level: run_id and instance_id (omit test_id). Paginate with limit and page.

  • Test-level: instance_id and test_id. The run is resolved server-side from the instance; optional run_id is ignored for lookup. Optional attempt selects a specific attempt; omit for the latest.

Authorizations
AuthorizationstringRequired

API key authentication using Bearer token

Query parameters
run_idstringOptional

Run identifier. Required for run-level (run_id only) and instance-level (run_id + instance_id, no test_id). For test-level (instance_id + test_id), ignored; the server resolves the run from the instance.

instance_idstringOptional

Instance identifier. Required for instance-level and test-level. Omit for run-level (use run_id only).

test_idstringOptional

Test identifier. When set, selects test-level detail and requires instance_id.

attemptintegerOptional

Attempt number (0-indexed); defaults to latest

formatstring · enumOptional

Response format. Falls back to Accept header when absent.

Default: jsonPossible values:
detailstring · enumOptional

Controls output verbosity to limit token count. 'default' returns all available data. 'compact' reduces output size by omitting the full steps array and limiting assets to 3 per category while preserving failure context and analysis. 'summary' minimizes output by including only error info and metadata.

Default: defaultPossible values:
limitinteger · min: 1 · max: 50Optional

Maximum number of failed tests per page (run-level and instance-level only)

Default: 10
pageintegerOptional

Page number for failed tests pagination, 0-indexed (run-level and instance-level only)

Default: 0
max_lengthinteger · min: 1 · max: 50000Optional

Truncate markdown response to this character limit (only applies when format=md). Useful for fitting context into AI prompts.

Responses
chevron-right
200

Context data

statusstring · enumRequiredPossible values:
dataone ofRequired
or
or
get
/context

Last updated

Was this helpful?