Skip to main content
Glama

pytest_runs

Trigger smoke, unit-runtime, unit-admin, or all pytest suites in the background and return a job ID for polling; retrieve a run or list recent runs.

Instructions

Pytest suite runs (agent_test_runs). action: trigger (suite ∈ smoke|unit_runtime|unit_admin|all — launches a background job and returns job_id IMMEDIATELY; this differs from the portal's /admin/tests page, which blocks the HTTP request until pytest finishes — poll via jobs action=get or pytest_runs action=get) | get (run_id) | list (recent runs). The trigger runs in this engine's own container against the local checkout (not env-scoped, unlike the eval/e2e tools' env= param) and returns a job_id to poll via the jobs tool.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "pytest_runs"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoConfig branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves.staging
limitNoMaximum number of rows to return.
suiteNoWhich pytest selection to run.smoke
actionNoOperation to run: trigger | get | list. The tool description lists what each action needs.list
run_idNoagent_test_runs UUID.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: trigger launches a background job and returns job_id immediately, explicitly contrasted with the portal page that blocks the HTTP request. It also discloses that execution occurs in this engine's own container against the local checkout. It stops short of stating permissions, cost/duration, or what happens to prior runs.

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

Conciseness3/5

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

The action map is front-loaded, which is good, but the text is a dense chain of nested parentheticals with hard line breaks. The polling instruction is stated twice (inside the trigger parenthetical and again in the final sentence), which is wasted space for an already cramped description.

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 five-parameter tool with no annotations but a full output schema, the description covers the async/polling model, the runtime container, and the env-independence caveat. Missing pieces like auth requirements, concurrent-trigger behavior, and limit semantics are minor given the output schema exists.

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?

Schema coverage is 100%, so baseline is 3, but the description adds real meaning: it maps each action to its parameters (suite for trigger, run_id for get), enumerates the suite selections, and clarifies that the env parameter does not scope this run unlike eval/e2e. The limit parameter is never addressed, so it is not fully compensating.

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 description names the resource (pytest suite runs / agent_test_runs) and enumerates the three operations with their required inputs: trigger(suite), get(run_id), list(recent runs). It also explicitly separates this tool from the jobs tool and from the portal's /admin/tests page, so an agent can identify it without opening the schema.

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?

Clear guidance for the trigger path: launch, then poll via jobs action=get or pytest_runs action=get. It also tells the agent what to expect from the sibling eval/e2e tools by noting they are env-scoped while this one is not. It does not, however, say when to choose list vs get or when not to trigger (e.g., concurrent runs).

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