Skip to content

Conversation

@jaredboynton
Copy link

Summary

This PR adds support for executing specific folders within a Postman collection using the runCollection tool.

Changes

New Feature: Folder Execution Support

The runCollection tool now accepts an optional folderId parameter that allows running only the requests within a specific folder of a collection, rather than the entire collection.

Implementation details:

  • Added folderId to the runCollection tool schema in runCollection.ts
  • Added folderId to CollectionRunParams interface in models.ts
  • Implemented resolveFolderName() in executor.ts to convert folder IDs to folder names
    • Newman's folder option expects folder names, not IDs
    • Supports matching by id, _postman_id, or uid fields
    • Falls back to the original value for direct folder name usage
  • Updated buildNewmanOptions() to resolve folder ID before passing to Newman
  • Added logging to show the resolved folder name during execution

Usage:

The folderId parameter accepts either:

  • A folder ID (e.g., 17929829-d36b7575-71d6-4eee-8a48-cbda89c11af8)
  • A folder name (e.g., Users API)

Bug Fixes

  • Newman Node 22 Compatibility: Upgraded Newman to version 6.2.1 to resolve compatibility issues with Node.js 22 (undici-related errors)
  • Request Delay Removed: Removed the 1-second delayRequest to improve execution speed within MCP timeout limits

Testing

Tested with a collection containing 5 folders (16 total requests). All folders executed successfully with 100% test pass rate, completing in under 0.5 seconds each.

…cution

- Add optional folderId parameter to runCollection tool schema
- Add folderId to CollectionRunParams interface in models.ts
- Implement resolveFolderName() in executor.ts to convert folder IDs to names
  - Newman's folder option expects folder names, not IDs
  - Supports matching by id, _postman_id, or uid fields
  - Falls back to original value for direct folder name usage
- Update buildNewmanOptions() to resolve folder ID before passing to Newman
- Add debug logging to show resolved folder name during execution

Bug fixes:
- Upgrade Newman to 6.2.1 for Node.js 22 compatibility (undici fix)
- Remove delayRequest to improve execution speed within MCP timeouts

This allows running specific folders within a collection instead of the
entire collection, useful for targeted test execution.
The dist/ folder was missing the compiled JavaScript for the folderId feature.
This caused '0 tools discovered' when running the MCP server from dist/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant