Skip to main content
Glama

Test (structured)

npm_test

Runs Vitest or Jest from package.json and returns compact structured test results, listing only failures by default for focused debugging.

Instructions

Run vitest or jest (picked from package.json) 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
cwdNoRequired. Project root directory
patternNoFilter tests by filename pattern
verboseNoInclude all tests in output (default: only failures)
coverageNoEnable coverage reporting

Output Schema

NameRequiredDescriptionDefault
suitesYes
summaryYes
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

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 burden and does well: it discloses runner auto-detection, output compactness, and the default filtering behavior that governs what the agent actually sees. Gaps remain around failure modes (no test script present, timeouts, whether coverage changes the result payload), which keeps it from a 5.

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 sentences, front-loaded with the action and the payoff, then the filtering default and its override. No filler and nothing buried.

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?

Output schema exists, so return values need minimal explanation, and the description correctly focuses on behavior rather than shape. Slightly incomplete for a zero-annotation tool in not covering what happens when no runner or test script is detected.

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 all four parameters are already documented in structured form; the description only restates verbose's default semantics. It adds no new meaning for cwd, pattern, or coverage beyond the schema.

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 (run) and resource (vitest/jest tests) and spells out the return shape: suites, pass/fail counts, failure messages. An agent can distinguish it from npm_lint, npm_typecheck, or dotnet_test 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?

Gives clear operational context: failures-only by default, verbose=true for full output, and the runner is auto-selected from package.json. It doesn't explicitly route to alternatives (e.g., npm_lint for style, python_test for other stacks), but the usage condition for this tool is unambiguous.

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