Skip to main content
Glama

run_tests

Executes pytest, unittest, jest, or vitest suites and returns pass/fail counts with trimmed failure details, collection errors kept separate, and the slowest tests.

Instructions

Run the tests and return counts plus only the useful details of each failure.

EXECUTES THE PROJECT'S CODE. Result: outcome (passed | failed | no_tests | timeout | crashed | startup_error), summary counts (passed/failed/error/skipped/xfailed/xpassed), failures (id, message, file:line of the innermost project frame, the relevant traceback frames only, trimmed stdout/stderr), collection_errors listed separately from failures (import errors never hide as test failures), the 5 slowest tests, and which interpreter was used. On timeout or crash it names the test that was running. The whole process tree is killed at the timeout.

selector: a file, directory or node id (pytest: tests/test_a.py::TestX::test_y; unittest: dotted name; jest/vitest: file path pattern). Default: everything. timeout: seconds, 1-3600. extra_args: only allow-listed flags, e.g. ["-x"], ["-k", "login"], ["-m", "not slow"], ["--maxfail=3"]; anything else is refused. python: interpreter path or 'uv'. runner: force pytest/unittest/jest/vitest (default: auto-detected, see detect_runner).

Input Schema

NameRequiredDescriptionDefault
pathNo.
pythonNo
runnerNo
timeoutNo
selectorNo
extra_argsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations supplied, the description assumes the full disclosure burden and does it well. It prominently warns that project code executes, enumerates possible outcomes, explains failure and collection-error reporting, identifies the active test on timeout or crash, states that the entire process tree is killed at timeout, and discloses refusal of non-allow-listed extra arguments.

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?

The purpose and code-execution warning are front-loaded, and the parameter guidance is compact and easy to scan. The long output catalog is somewhat dense and partly unnecessary because an output schema exists, although most of its details convey useful behavioral distinctions rather than filler.

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?

For a six-parameter tool that executes arbitrary project code, this provides nearly enough operational, safety, and result-interpretation context to invoke it correctly, with the output schema supplementing the return-value details. The unexplained path parameter and lack of guidance about non-executing or more specialized siblings remain meaningful but limited gaps.

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

Parameters4/5

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

Despite 0% schema description coverage, it documents selector with framework-specific syntax and a default, timeout with units and bounds, extra_args with examples and its allow-list restriction, python with accepted interpreter forms, and runner with supported values and auto-detection. The path parameter is not explained, leaving its relationship to the project, selector, and working directory unclear.

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?

The opening sentence clearly states the verb and resource: run tests and return counts plus focused failure details. The supported runners and selectors further clarify scope, but the description does not explicitly distinguish this tool from execution-related siblings such as rerun_failed or flaky_check.

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

Usage Guidelines4/5

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

It gives practical invocation guidance: run everything by default, select files, directories, node IDs, or framework-specific patterns, force a runner when needed, and consult detect_runner for auto-detection. It does not explain when not to execute tests or when siblings such as list_tests, coverage_summary, or rerun_failed are preferable.

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