Get test run commands
get_run_commandsReturns POSIX shell commands to run tests related to changed file paths, with each command listing its config, projects, files, and runner caveats.
Instructions
Returns POSIX shell commands for test files related to the changed paths. Run them from the scanned directory. Each command gives its config, projects, files and any runner caveat. A runner can run more tests than the matched declarations. The server only returns commands. Follow nextCursor for more.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"related": "<related>"
},
"name": "get_run_commands"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | The most items to return. | |
| cursor | No | nextCursor from the previous answer, for the next page. Keep the other arguments the same. | |
| related | Yes | Changed files relative to the server root, as git diff --name-only writes them. | |
| patterns | No | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with, or without them the files the configs in `directory` and below it run. | |
| directory | No | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. | |
| framework | No | The test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses. | |
| expandCases | No | Lists each case of a .each or .for table and each pass of a loop as its own test, with the name the runner gives it and caseIndex, as the runner registers them. Ids differ from those without it, so pass the same value to get_tests. Default: false, one test per declaration with caseCount. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | Yes | ||
| total | Yes | All matching items, on every page. | |
| commands | Yes | One page of runner commands grouped by config and, for Cypress, testing type. | |
| framework | Yes | ||
| nextCursor | Yes | ||
| scanErrors | Yes | Problems of level error in the scan, which may leave tests out of the answer. | |
| frameworkVersion | Yes |