Skip to main content
Glama

Get test run commands

get_run_commands
Read-onlyIdempotent

Returns 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

NameRequiredDescriptionDefault
limitNoThe most items to return.
cursorNonextCursor from the previous answer, for the next page. Keep the other arguments the same.
relatedYesChanged files relative to the server root, as git diff --name-only writes them.
patternsNoGlobs 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.
directoryNoA folder inside the project to scan, relative to its root, such as "packages/web". Default: the root.
frameworkNoThe test runner. Default: the one the server was started with, otherwise the one the project in `directory` uses.
expandCasesNoLists 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

NameRequiredDescriptionDefault
hintYes
totalYesAll matching items, on every page.
commandsYesOne page of runner commands grouped by config and, for Cypress, testing type.
frameworkYes
nextCursorYes
scanErrorsYesProblems of level error in the scan, which may leave tests out of the answer.
frameworkVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/idempotentHint/non-destructive and closed-world, so the bar is lower; the description still adds real value by disclosing that the server only returns commands and does not execute them, that each command carries its config, projects, files and runner caveat, and that a runner may run more tests than the matched declarations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Six short sentences, front-loaded with what is returned and where to run it; every sentence carries information. Slightly telegraphic phrasing ('The server only returns commands') could be tightened, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present the description needn't explain return values, and the 100%-covered input schema carries parameter detail. What remains—execution model, caveats, pagination—is covered, though the lack of routing to sibling tools for test-level queries leaves a small gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all seven parameters including the expandCases caveat about differing ids. The description only loosely echoes 'related' (changed paths), 'directory' (scanned directory), and 'cursor' (nextCursor), adding no syntax or format detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: returns POSIX shell commands for test files related to changed paths. The resource (commands, not test ids or summaries) is distinguishable from siblings like get_tests or test_summary, though it never names an alternative explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives some operational context ('Run them from the scanned directory') and pagination guidance ('Follow nextCursor for more'), but never says when to prefer this over get_tests or find_tests, nor any prerequisite beyond the schema's required 'related' array.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.