Skip to main content
Glama

run_tests

Read-onlyIdempotent

Executes a repository's pytest suite or a specified target to surface reproducible failures and pinpoint likely bug locations. Requires environment setup first.

Instructions

Run the repo's pytest suite (or one target: a file, dir or node id) in its environment.

Use this to find real, reproducible test failures. Returns counts, the exact command and commit (ready to use as Evidence), and up to max_failures failures. Each failure has the message, a trimmed traceback, and location: the deepest traceback frame inside the repo that is NOT a test file, i.e. where the bug most likely lives (null if only test code ran). Requires setup_environment first. Check failures with detect_flaky_tests before reporting.

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": {
      "repo": "<repo>"
    },
    "name": "run_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYes
targetNo
timeout_sNo
max_failuresNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (which already declare readOnly/idempotent/non-destructive), the description discloses the return payload — counts, exact command, commit, and up to `max_failures` entries — and defines the semantics of each failure's `location` field including the null case. The setup_environment prerequisite adds operational context the annotations cannot express.

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?

It is front-loaded with the action and target, then layers on usage, return shape, and prerequisites in a logical order with no filler. The `location` explanation is slightly verbose but is genuinely the highest-value detail in the text, so it earns its space.

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

Completeness5/5

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

There is no output schema, and the description fully covers the return contract (counts, command, commit, failure entries, location semantics). Combined with the prerequisite and follow-up tool guidance, an agent has everything needed to invoke it and interpret results correctly.

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 description coverage is 0%, so the description must carry all four parameters; it explains `target` (file, dir, or node id) and `max_failures` (caps returned failures) well. It says nothing about `repo` or `timeout_s`, leaving two parameters with no meaning beyond their bare types, so it only partially compensates for the coverage gap.

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

Purpose5/5

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

The first sentence gives a specific verb and resource ("Run the repo's pytest suite") plus the scoping variant (one `target`: file, dir or node id) and the execution environment. An agent can immediately distinguish this from siblings like run_static_analysis or analyze_repo without opening any schema.

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

Usage Guidelines5/5

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

It states the purpose-directed use case ("find real, reproducible test failures"), a hard prerequisite ("Requires setup_environment first"), and a downstream routing rule ("Check failures with detect_flaky_tests before reporting"). Both the when-to-use and the ordering relative to named siblings are explicit.

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