Skip to content

feat: add folderId parameter to runCollection for folder-specific execution#96

Closed
jaredboynton wants to merge 121 commits intopostmanlabs:mainfrom
jaredboynton:feat/folder-execution
Closed

feat: add folderId parameter to runCollection for folder-specific execution#96
jaredboynton wants to merge 121 commits intopostmanlabs:mainfrom
jaredboynton:feat/folder-execution

Conversation

@jaredboynton
Copy link
Copy Markdown

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.

garciasdos and others added 30 commits June 10, 2025 12:17
* feat: first setup

* refactor: apply @akira28 suggestions

* docs: apply @akinard-postman suggestions

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>

* refactor: README.md

---------

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>
postmanlabs#2)

* fix: update HTTP server URL and authorization method in README example

* feat: add codeowners
…setup-description

feat: improve stdio setup
…anlabs#10)

* feat: add MCP HTTP streamable server installation instructions

* Update README.md

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>

* Update README.md

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>

---------

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>
* feat: add link the the public MCP collection to readme

* Update README.md

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>

---------

Co-authored-by: Ashley Kinard <113702138+akinard-postman@users.noreply.github.com>
Co-authored-by: postman-distribution-bot[bot] <124679000+postman-distribution-bot[bot]@users.noreply.github.com>
* chore: sync tools from postman-mcp-server

* refactor: re-enable exec property

---------

Co-authored-by: postman-distribution-bot[bot] <124679000+postman-distribution-bot[bot]@users.noreply.github.com>
Co-authored-by: Diego García <diego.garcia@postman.com>
Co-authored-by: postman-distribution-bot[bot] <124679000+postman-distribution-bot[bot]@users.noreply.github.com>
prepend with "file://" if on windows. Addresses postmanlabs#19
* feat: migrate tests to Vitest and add integration tests

- Updated testing framework from Jest to Vitest in package.json.
- Added GitHub Actions workflow for running Vitest tests on push and pull requests.
- Created integration tests for workspace operations using Vitest, including workspace creation, listing, searching, updating, and deletion.
- Introduced a WorkspaceDataFactory for generating test workspace data and tracking performance metrics.

* fix: update CODEOWNERS

* feat: run ci on multiple os

* fixup! feat: migrate tests to Vitest and add integration tests

* fix: windows tools import
* feat: add environments crud

* refactor: unify direct tests into 1 file

* fixup! refactor: unify direct tests into 1 file

* refactor: remove unused benchmark insights
…s#26)

Update README.md

Add a note about the 128 tool limit in VS Code.
Co-authored-by: postman-distribution-bot[bot] <124679000+postman-distribution-bot[bot]@users.noreply.github.com>
rubenbaraut and others added 22 commits November 11, 2025 17:59
* fix: mcp registry release

* fixup! fix: mcp registry release
…s#83)

* chore: sync tools, entrypoint, and tests from postman-mcp-server

* refactor: remove unused dependencies

* chore: npm run build

---------

Co-authored-by: postman-distribution-bot[bot] <124679000+postman-distribution-bot[bot]@users.noreply.github.com>
Co-authored-by: Diego García <diego.garcia@postman.com>
* feat: add code generation toolset and update enabled resources

- Introduced `getCodeGenerationInstructions` tool to provide step-by-step guidance for generating API client code from Postman collections.
- Added `getCollectionMap` tool to retrieve a recursive index of all folders and requests in a Postman collection.
- Updated `enabledResources` to include new tools and modified the `excludedFromGeneration` list.
- Enhanced the `run` function to support a new `--code` argument for selecting code generation tools.
- Adjusted `ServerContext` to accommodate the new 'code' server type.

* feat: add code toolset bundling flows

* feat: add searchPostmanElements tool

* Various README updates for code toolset

* Tweaks to code manifest description and long description

---------

Co-authored-by: Josh Dzielak <174777+joshed-io@users.noreply.github.com>
* refactor: move to OIDC publications

* fixup! refactor: move to OIDC publications

* fixup! fixup! refactor: move to OIDC publications

* fixup! fixup! fixup! refactor: move to OIDC publications

* fixup! fixup! fixup! fixup! refactor: move to OIDC publications
* Revert "refactor: move to OIDC publications (postmanlabs#89)"

This reverts commit 2b08417.

* refactor: move to OIDC publications
…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.

10 participants