Skip to main content
Glama

trim_tests

Read-only

Shrinks test-runner output from pytest, unittest, jest, go test, and cargo test down to failures and summary, so you can skip reading whole test logs; omitted parts stay available via expand.

Instructions

Shrink test-runner output (pytest, unittest, jest, go test, cargo test) to the failures and the summary. Use it instead of reading a whole test log. Omitted parts can be fetched with expand.

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": "trim_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFile to read, inside the server's root folder. Preferred way to pass input.
textNoThe text itself. Only for small inputs: large text costs tokens to send.
commandNoA command to run and trim (no shell). Only works if started with --allow-run.
max_failure_linesNoMost lines kept per failure.

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?

Annotations already carry the safety profile (readOnlyHint true, destructiveHint false, openWorldHint false), and the description adds substantive behavior beyond them: output is lossy by design, it retains failures plus the summary, and the loss is recoverable via expand. It does not disclose that the tool can execute a command when started with --allow-run, which is the one notable behavioral trait left for the schema to carry.

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?

Two sentences, zero filler, with the core operation and its output scope front-loaded and the recovery path last. Every clause earns its place.

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, full annotation coverage, and 100% schema descriptions, the description only needs to convey purpose, selectivity, and recovery — all present. The remaining gap is that the command-execution input mode is invisible from the description alone, requiring the agent to read the schema.

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 100%, so path/text/command/max_failure_lines are already explained, including the token-cost tradeoff and the --allow-run caveat. The description adds no parameter-level meaning of its own, which is the expected baseline when the schema does the heavy lifting.

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?

Specific verb+resource: "Shrink test-runner output" with the concrete formats it handles (pytest, unittest, jest, go test, cargo test) and the exact reduction target (failures and summary). It also names the sibling that recovers omitted content, so an agent can place it against expand/trim_log without opening a 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?

"Use it instead of reading a whole test log" gives a clear selection rule against the naive alternative, and "Omitted parts can be fetched with expand" names the follow-up path. It stops short of explicit when-not guidance (e.g. that non-test output belongs to a different trim tool), so it is clear context rather than a full routing rule.

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