test

A command for running Postman collection tests, which check whether a group of API requests behaves as expected. It also analyzes failed tests and suggests code fixes.

In plain words
What is it for?
Use it to find a Postman workspace and collection, run its tests in a selected environment, review pass and failure results, and investigate failed API checks.
Why use it?
It removes the need to run collection tests manually and helps explain what went wrong when requests fail.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/postman-devrel/postman-claude-code-plugin/test
Clone the repo
git clone --depth 1 https://github.com/Postman-Devrel/postman-claude-code-plugin
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 833 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00833
Opus 5 $0.00008 $0.00417
Sonnet 5 $0.00003 $0.00167
Haiku 4.5 $0.00002 $0.00083

Measured yesterday against content hash ed840f6ea303, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/test.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run Collection Tests

Execute Postman collection tests directly from Claude Code. Analyze results, diagnose failures, and suggest code fixes.

Prerequisites

The Postman MCP Server must be connected. If MCP tools aren't available, tell the user: "Run /postman:setup to configure the Postman MCP Server."

Workflow

Step 1: Find the Collection

  1. Call getWorkspaces to find the target workspace
  2. Call getCollections with the workspace parameter. Use the name filter if the user specified a collection.
  3. If the user provides a collection ID directly, skip to Step 2.

Step 2: Run Tests

Call runCollection with the collection UID in OWNER_ID-UUID format. Get the UID from the getCollection response's uid field.

If the collection uses environment variables:

  1. Call getEnvironments to list available environments
  2. Ask which environment to use (or detect from naming convention)
  3. Pass the environment ID to runCollection

Step 3: Parse Results

Present results clearly:

Test Results: Pet Store API
  Requests:  15 executed
  Passed:    12 (80%)
  Failed:    3
  Avg time:  245ms

  Failures:
  1. POST /users → "Status code is 201" → Got 400
     Request: createUser
     Folder: User Management

  2. GET /users/{id} → "Response has email field" → Missing
     Request: getUser
     Folder: User Management

  3. DELETE /users/{id} → "Status code is 204" → Got 403
     Request: deleteUser
     Folder: User Management

Step 4: Diagnose Failures

For each failure:

  1. Call getCollectionRequest to see the full request definition
  2. Call getCollectionResponse to see expected responses
  3. Check if the API source code is in the current project
  4. Explain what the test expected vs what happened
  5. If code is local, find the handler and suggest the fix

Step 5: Fix and Re-run

After fixing code:

  1. Offer to re-run: "Tests fixed. Want me to run the collection again?"
  2. Call runCollection again
  3. Show before/after comparison

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 85 lines · 16 tokens per session scan A ed840f6ea303

Subscribe to this mod's changes

test is a command published in the GitHub repository Postman-Devrel/postman-claude-code-plugin (38 stars, last pushed 26d ago), licensed Apache-2.0. It adds 16 tokens to every session and 833 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories