Skip to main content
Glama

Python test (structured)

python_test

Runs pytest and returns structured test results with pass/fail counts and failure messages, listing only failures by default for compact output.

Instructions

Run pytest and return structured test results: suites, pass/fail counts, failure messages. Much more compact than raw test output. Only failures are listed by default; use verbose=true for all tests.

Input Schema

NameRequiredDescriptionDefault
cwdYesProject root directory
pathNoSpecific test path or file to run
patternNoFilter tests by expression (-k pattern)
verboseNoInclude all tests in output (default: only failures)

Output Schema

NameRequiredDescriptionDefault
suitesYes
summaryYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it discloses the default output policy (failures only) and touts compactness, but says nothing about prerequisite installation, timeouts, side effects of executing test code, or what happens on collection errors.

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

Conciseness5/5

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

Three short sentences, zero waste, with the purpose and the output-shape benefit front-loaded before the default/verbose detail.

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?

An output schema exists so return values need not be explained, and the description covers the default-vs-verbose behavior; only the lack of any execution-context caveats keeps it short of full marks.

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% and each parameter is already documented, including the verbose default; the description merely restates the verbose behavior and adds no format or semantics beyond the schema. Baseline 3 applies.

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?

States a specific verb and resource ('Run pytest') plus what it returns ('suites, pass/fail counts, failure messages'), which cleanly separates it from the other test runners in the sibling list (dotnet_test, npm_test, bash_test) by language/runner.

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?

The description implies the Python-testing context and gives an explicit rule for the verbose flag, but it never states when to reach for this over python_lint, python_typecheck, or a generic run tool, and offers no exclusions.

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