product: assert audience: test-developer, operator, ai-assistant authority: normative
MCP Tools — Test Execution
Tools for starting, monitoring, and aborting test runs.
All tool responses include a top-level station field containing the StationLabel
configured for this server instance.
See also:
tools-reference.mdfor the full tool index.
start_test
Start a test execution from a YAML file path.
⚠️ A station runs up to its number of execution slots at once —
MaxParallelExecutions(default 1), capped by the runner pool.get_station_inforeportsslots.slotCountand which slots are busy. Callingstart_testwhen every slot is busy returns409 Conflict("Station at capacity").Each
start_testthat finds a free slot starts immediately and returns its ownexecutionId; each run is independent. Steps that share an instrument must declarerequires:(seeyaml/runtime-control.md).If asked to run a test multiple times (e.g. "run 10 times and report the average"), run them one after another when the user asks for sequential runs or the station has a single slot:
- Call
start_test- Wait for it to finish — use
wait_for_test_completionor pollget_test_statusuntilverdictis no longerRUNNING- Repeat from step 1
| Parameter | Type | Required | Description |
|---|---|---|---|
yamlFilePath |
string | Yes | Absolute path to the .yaml file on the API server. Use list_available_tests or get_available_test_files to discover valid paths |
serialNumber |
string | Yes | The device under test serial number. Stored with the result |
operatorId |
string | No | The operator running the test. Stored with the result |
unattendedMode |
bool | No | When true, prompt steps auto-respond without human input. See unattended-mode.md |
Returns: execution — executionId, testName, status, startTime
Calls: POST /api/testexecution/run
Error — 409 Conflict: Returned when the station is at capacity (all
MaxParallelExecutions slots in use). Response body contains activeCount,
maxParallel, activeExecutionIds and activeExecutions (slot, execution id, test name,
serial number and step progress of each run holding a slot). Wait for a slot to free up, or
call abort_test on a running execution. A 409 is also returned when MES rejects the
start; its message says so, and waiting does not help.
Note: The
executionIdin the response is the GUID you pass to all other execution tools (get_test_status,abort_test,get_execution_log, etc.).
get_test_status
Returns the current status and header details of a test execution.
| Parameter | Type | Required | Description |
|---|---|---|---|
executionId |
GUID | Yes | The execution ID returned by start_test |
Returns: result — full TestResultDetailDto including verdict, stepCount, child executions, artifacts;
waitingForOperator (bool) and pendingPrompt — while the run is going, the operator prompt it is
blocked on (promptId, stepName, title, message, buttons[], input, timeout; see
tools-prompts.md), or null
Calls: GET /api/test-results/{id}, and GET /api/testexecution/{id}/prompt while the run has not ended
A run blocked on a prompt looks exactly like a slow step from its status alone. If
waitingForOperatoristrue, the run will not move until somebody answers — at the station, or withanswer_prompt.
abort_test
Signals the running test executor to stop at the next safe point.
| Parameter | Type | Required | Description |
|---|---|---|---|
executionId |
GUID | Yes | The execution ID to abort |
Returns: message confirming the abort signal was sent
Calls: POST /api/testexecution/{executionId}/abort
Note: Abort is asynchronous. The execution transitions to
ABORTEDverdict after the current step finishes. Pollget_test_statusto confirm.
wait_for_test_completion
Polls a test execution until it reaches a terminal state, then returns the full result.
Use this instead of repeatedly calling get_test_status manually.
| Parameter | Type | Required | Description |
|---|---|---|---|
executionId |
GUID | Yes | The execution ID to wait for |
timeoutSeconds |
int | No | Maximum seconds to wait before throwing a timeout error. Default: 300 |
Returns: result — same as get_test_status once the execution is complete
Throws: TimeoutException if the execution does not complete within timeoutSeconds
list_available_tests
Lists all YAML test files available from installed (activated) packages.
| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) |
Returns: tests[] — each item has packageName, testName, filePath, requiredTags
Calls: GET /api/packages/test-files
validate_yaml
Validates YAML test content without executing it. Use before committing a new test.
| Parameter | Type | Required | Description |
|---|---|---|---|
yamlContent |
string | Yes | The raw YAML string to validate |
Returns: validation.isValid (bool), validation.errors[] — each error has a message and line number
Calls: POST /api/yaml/validate
get_execution_log
Returns log messages for a test execution as a flat list of strings.
| Parameter | Type | Required | Description |
|---|---|---|---|
executionId |
GUID | Yes | The execution ID |
Returns: logs[] — plain message strings in chronological order
Calls: GET /api/test-results/{id}/logs
To get structured log entries (with timestamps, step names, log levels), use
get_execution_logsintools-reports.mdinstead.
check_mes_routing
Queries the MES for routing information for a serial number. Tells you whether testing is allowed on this station and which test options are available.
| Parameter | Type | Required | Description |
|---|---|---|---|
serialNumber |
string | Yes | The serial number to check |
Returns: routing.isKnown, routing.options[], routing.rejectionReason (if blocked)
Calls: GET /api/mes/routing?serialNumber={sn}
When the station is not connected to a real MES, the API uses
AllowAllMesServicewhich returnsisKnown: truewith an empty options list. Testing is always allowed.