feat(test-management): add listTestPlans and getTestPlan tools#283
Merged
gaurav-singh-9227 merged 1 commit intobrowserstack:mainfrom Apr 27, 2026
Merged
Conversation
Expose Test Plans as first-class objects in the MCP so agents can retrieve a plan by TP-* identifier instead of falling back to test runs. getTestPlan chains the plan-details and linked-runs endpoints into a unified response with metadata, linked test runs, total test-case count across runs, and a derived run-state summary — suitable for generating test documentation and QA status reports. listTestPlans covers discovery when the identifier is not known. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
ruturaj-browserstack
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
listTestPlansandgetTestPlanMCP tools, exposing BrowserStack Test Plans as first-class objects (previously agents fell back to test runs when given a TP-* identifier).getTestPlanchainsGET /test-plans/{id}+GET /test-plans/{id}/test-runsand returns a unified payload: metadata, linked runs, total test-case count across runs, and a derived run-state summary — suitable for auto-generating test documentation / QA status reports.listTestPlanscovers discovery when the TP-* identifier is not known, mirroring the existinglistTestRunspattern.Customer context
This is driven by a customer use case (Danske / Himanshu's Slack thread): they want to auto-generate Confluence test documentation from a Test Plan ID via MCP. Current behavior either returns test runs or nothing. This PR covers 4 of the 5 fields they asked for:
getTestPlangetTestPlangetTestPlan—total_test_casesderived from linked runsgetTestPlan—status_summary+test_runs_countTest plan
npm test— 127 passing (4 new tests: success + error for each tool)npx tsc --noEmit— cleannpm run lint— cleannpm run build— producesdist/tools/testmanagement-utils/{list-testplans,get-testplan}.jstools/listviadist/index.jsadvertises bothlistTestPlansandgetTestPlanTP-*(pending reviewer)🤖 Generated with Claude Code